Search Postgresql Archives

Re: Server timestamp

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, May 3, 2009 at 7:04 AM, Chris Bartlett
<c.bartlett@xxxxxxxxxxxxxxx> wrote:
> Date and time functions like current_time return the client machine's time.
> Is there a way of getting the database server's time? I have a situation
> that requires comparison of a date stamp on records with "today", but I need
> to avoid the possibility of a user changing their computer's clock time.

I think you're confused.  According to the docs:

CURRENT_TIME and CURRENT_TIMESTAMP deliver values with time zone;
LOCALTIME and LOCALTIMESTAMP deliver values without time zone.

The time delivered is the server's time, adjusted to client's
timezone.  If you want the server time without timezone then use
localtime / localtimestamp.

It's never the client's time.

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux