I'm using CURRENT_TIMESTAMP
in Google Cloud SQL and according to Google , it returns the server's current time.
Currently, with the time that it returns, it looks like the server's at UTC -1 (ie, in the Atlantic Ocean). This is not very helpful.
How do I change the timezone and have it display the right time (ie, a time zone of my own choosing) whenever I call CURRENT_TIMESTAMP
?
There is a new way to to change Google cloud SQL time zone https://stackoverflow.com/a/29758598/4121388
Instructions: https://cloud.google.com/sql/docs/mysql-flags
Cloud SQL sets the system time as UTC.
You can set the timezone for an individual session with a statement like:
SET @@session.time_zone='-07:00';
You can use named (and daylight savings aware) timezones such as "US/Pacific" if you first set up the timezone table by running a system command like:
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -h YOUR_INSTANCE_IP -u root -p mysql
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.