NOW() returns the current time, as known by the Linux server, in the
time_zone set for the connection. By default, this seems to be "system",
meaning whatever time zone the server picked up from the system at the time
it was started. In Linux, this would be the environment variable TZ. If you
change the connection time zone with

SET @@time_zone = "US/Pacific"

then NOW() will return the current time in PST / PDT. The system's time zone
can be overridden with a command line parameter when starting the server,
and that would affect all of the connections by default. The time zones are
stored in time zone related tables in the mysql data base, and there are
utilities to load those tables from the system time zone tables (I forget
the exact command).

Regards,

Jerry Schwartz
Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032

860.674.8796 / FAX: 860.674.8341


> -----Original Message-----
> From: murthy gandikota [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, March 21, 2007 6:05 PM
> To: mysql@lists.mysql.com
> Subject: What does NOW() return: linux time or something else?
>
> Hi
>   I tried to look up the time functions specifically for the
> disparity between NOW() and the linux time obtained with
> 'date'. Why are they different? How can I set the database time?
>
>   Thanks
>   Murthy
>
>
> ---------------------------------
> Looking for earth-friendly autos?
>  Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.
>




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to