MySQL - specific time zone at insert time

Let's say I have 2 fields / columns TIMESTAMP, eventand stamp. In the field event, when we insert, I want to set the time zone so that the event uses the time zone specified by the user. However, I do not want to stampuse this time zone. I want to stampuse any default timezone used by the server.

SET time_zone = <UTC offset>;

does not work, as this will affect eventand stamp, where we want it to eventbe affected by the time zone.

Is there a way to set the time zone for certain columns during insertion?

+3
source share
2 answers

MySQL is not worried about time zones when inserting a date.

/ GMT (+00: 00) , (, "/" ).

Edit

, , GMT , /.

+1
SET time_zone = <user timezone>;    
INSERT ... SET event = CURRENT_TIMESTAMP(), stamp = UTC_TIMESTAMP(), ...

http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html

0

All Articles