Re: postgres time zone settings(time difference in Server and client) - Mailing list pgsql-sql

From Richard Huxton
Subject Re: postgres time zone settings(time difference in Server and client)
Date
Msg-id 48899B8A.7060404@archonet.com
Whole thread Raw
In response to Re: postgres time zone settings(time difference in Server and client)  ("Anoop G" <anoopmadavoor@gmail.com>)
Responses Re: postgres time zone settings(time difference in Server and client)  ("Anoop G" <anoopmadavoor@gmail.com>)
List 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 by date:

Previous
From: "Anoop G"
Date:
Subject: Re: postgres time zone settings(time difference in Server and client)
Next
From: "Pawel Socha"
Date:
Subject: Re: postgres time zone settings(time difference in Server and client)