Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: postgres UTC different from perl?



Louis-David Mitterrand wrote:
Hi,

when trying:
psql template1 -c "select  date_part('epoch',current_date at time zone 'UTC');"
date_part ------------
1198015200

the result is different from
perl -MDateTime -le 'print DateTime->today(time_zone => "UTC")->epoch;'
1198022400

Is there an issue with postgresql?

Well, there's one of 3 possibilities:

1. PostgreSQL's date/time code is broken.
2. Perl's DateTime module is broken.
3. One of those bits of code doesn't do what you think it does.

I'm not sure that (CURRENT_DATE AT TIME ZONE 'UTC') does what you think it does. Try setting your timezone to various offsets and exploring.

--
  Richard Huxton
  Archonet Ltd



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group