MySQL's NOW()
function returns a timestamp in local time (i.e. the time in the server's timezone). From the documentation (emphasis mine):
NOW([fsp])
Returns the current date and time as a value in 'YYYY-MM-DD hh:mm:ss' or YYYYMMDDhhmmss format, depending on whether the function is used in string or numeric context. The value is expressed in the session time zone.
If you need the time in UTC you'd use UTC_TIMESTAMP()
instead, like this:
INSERT INTO ^revrate (userid, siteid, revrate, revratetitle, revratenote, revratetime)
VALUES (#, $, #, $, $, UTC_TIMESTAMP());
Edit: If you want to convert a timestamp from one timezone to another you could use the CONVERT_TZ()
function for that:
INSERT INTO ^revrate (userid, siteid, revrate, revratetitle, revratenote, revratetime)
VALUES (#, $, #, $, $, CONVERT_TZ(#, @@session.time_zone, '-07:00'));
@@session.time_zone
in that query is the time_zone
variable of the current session.