Timestamp intervall in postgresql

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!

What values do the $beginTimestamp / $endTimestamp have? Or how do you set these?

I set it to unix epoch time.




$beginTimestamp = 1313138101;

$endTimestamp = 1314002101;