Re: postgres time zone settings(time difference in Server and client)

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: postgres time zone settings(time difference in Server and client)
Дата
Msg-id 48899B8A.7060404@archonet.com
обсуждение исходный текст
Ответ на Re: postgres time zone settings(time difference in Server and client)  ("Anoop G" <anoopmadavoor@gmail.com>)
Ответы Re: postgres time zone settings(time difference in Server and client)  ("Anoop G" <anoopmadavoor@gmail.com>)
Список pgsql-sql
Anoop G wrote:
> Hai all,
> 
>    I have  database running on server. I am using python to run my
> application.postgres client is running on the clients .All clients are
> connected to a single database running on server. Each time application
> starts ,the login time is taken from server  using the query
> """select CAST ( timeofday() AS timestamp"""
> 
> But the problem the time which I got is different from that of server
> machine . I Think the postgres client is adding some values to the server
> time. How can I solve this .Is there any configuration setting for client to
> solve this?.In which location client's configuration file is stored( I am
> using Linux(Debian )?.

1. If you have a recent version of PostgreSQL use clock_timestamp()
2. Why are you using timestamp without timezone?

SELECT clock_timestamp();        clock_timestamp
-------------------------------- 25/07/2008 10:21:58.464055 BST

SET timezone='EST';

SELECT clock_timestamp();        clock_timestamp
-------------------------------- 25/07/2008 04:22:19.584367 EST

--   Richard Huxton  Archonet Ltd


В списке pgsql-sql по дате отправления:

Предыдущее
От: "Anoop G"
Дата:
Сообщение: Re: postgres time zone settings(time difference in Server and client)
Следующее
От: "Pawel Socha"
Дата:
Сообщение: Re: postgres time zone settings(time difference in Server and client)