On 08/07/2012 08:36 PM, Shridhar
Daithankar wrote:
Date/time processing has lots of potential gotchas. Spend some quality-time with: http://www.postgresql.org/docs/current/static/datatype-datetime.html Note that short abbreviations and numerical offsets are simple offsets from UTC and will require you to change the offset as appropriate for each timestamp you want to enter. For example it is perfectly OK to enter midnight on new-year's day Eastern Daylight Time. PostgreSQL sees this as an offset of 4-hours from UTC which you could also specify as -04. Since January 1 is winter in New York, this may not be what you want. select '2012-01-01 0000 EDT'::timestamptz at time zone 'UTC'; timezone --------------------- 2012-01-01 04:00:00 If you want PostgreSQL to account for DST rules (including how the rules have changed historically), use the timezone name: select '2012-01-01 0000 America/New_York'::timestamptz at time zone 'UTC'; timezone --------------------- 2012-01-01 05:00:00 Cheers, Steve |