Обсуждение: Time Zone Setting

Поиск
Список
Период
Сортировка

Time Zone Setting

От
James G Wilkinson
Дата:
I just ran into a small mystery.  I am trying to set the time zone
during my session and here is what happens:

megan=# set timezone to 'EST'
megan=# do some work here
megan=# set timezone to 'PST'
ERROR:  unrecognized time zone name: "PST"
megan=# set timezone to 'PDT'
ERROR:  unrecognized time zone name: "PDT"
megan=# set timezone to 'MST'
megan=# set timezone to 'GMT'
megan=# select version();
                                                 version
--------------------------------------------------------------------------------------------------------
PostgreSQL 8.1.3 on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC)
4.0.0 20050519 (Red Hat 4.0.0-8)

My default timezone is PDT for this time of year.

I am a bit mystified.  Any suggestions?

Regards,

Jim

Re: Time Zone Setting

От
Michael Fuhr
Дата:
On Fri, Jul 28, 2006 at 01:59:55PM -0700, James G Wilkinson wrote:
> I just ran into a small mystery.  I am trying to set the time zone
> during my session and here is what happens:

You can find the list of acceptable time zone names in Appendix B
of the documentation:

http://www.postgresql.org/docs/8.1/interactive/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE

> My default timezone is PDT for this time of year.

Try 'PST8PDT' or 'US/Pacific'.

--
Michael Fuhr

Re: Time Zone Setting

От
James G Wilkinson
Дата:
Doh! Brain cramp! 

I have received a couple of replies to this effect.  So much for
looking at the correct table (i.e., B.6).  Odd though that some
of the values from Table B.4 work as well for
"SET TIMEZONE TO <timezone>."

Regards,

Jim

Michael Fuhr wrote:
On Fri, Jul 28, 2006 at 01:59:55PM -0700, James G Wilkinson wrote: 
I just ran into a small mystery.  I am trying to set the time zone
during my session and here is what happens:   
You can find the list of acceptable time zone names in Appendix B
of the documentation:

http://www.postgresql.org/docs/8.1/interactive/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE
 
My default timezone is PDT for this time of year.   
Try 'PST8PDT' or 'US/Pacific'.