Re: Casting and Timestamp

From: Mark Gibson <mark(at)gibsonsoftware(dot)com>
To: Mark Gibson <mark(at)gibsonsoftware(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Casting and Timestamp
Date: 2006-06-25 22:36:51
Message-ID: 449F1003.6050504@gibsonsoftware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-06-26 02:15:10 Re: Casting and Timestamp
Previous Message Mark Gibson 2006-06-25 22:24:49 Casting and Timestamp