Hello,
I have a Postgres table:
CREATE TABLE temperature
(
temp_id integer NOT NULL DEFAULT nextval(('seq_temperature'::text)::regclass),
temp_date timestamp without time zone NOT NULL DEFAULT now(),
temp_current double precision NOT NULL DEFAULT 0.0,
)
I want to list all temperature in date interval.
$condition = new CDbCriteria;
$condition->addBetweenCondition('temp_date', $beginTimestamp, $endTimestamp);
return Temperature::model()->findAll($condition);
SQLSTATE[22007]: Invalid datetime format: 7 ERROR: invalid input syntax for type timestamp: "1313138101". The SQL statement executed was: SELECT * FROM "temperature" "t" WHERE temp_date BETWEEN :ycp0 AND :ycp1
Thanks!