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: Casting and Timestamp



Mark Gibson wrote:
I have unexpected results when trying to cast a string to a timestamp:

test=# select  TIMESTAMP WITH TIME ZONE '2006/06/25 06:00:00 GMT-5'
test-# ;
      timestamptz
------------------------
 2006-06-24 20:00:00-05


Seems that what I get is about 10 hours earlier than I expect...

Any ideas why this is happening?  Did I assume too much in the cast?


Answered my own question - apparently the 'GMT' portion isn't understood by postgresql:
template1=# select  TIMESTAMP WITH TIME ZONE '2006/06/25 06:00:00-05'
template1-#
template1-# ;
      timestamptz
------------------------
 2006-06-25 06:00:00-05
(1 row)




Home | Main Index | Thread Index

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