中文字幕日韩一区二区_国产一区二区av_国产毛片av_久久久久国产一区_色婷婷电影_国产一区二区精品

How do I change MySQL timezone?



However, there are ways for you to get results that are in your preferred timezone. First determine how many hours your desired timezone is off from MST. For example, EST is +2 hours. PST is -1 hour.

Knowing the time offset, you can replace all your SQL statements of 


SELECT NOW();

with


SELECT DATE_ADD(NOW(), INTERVAL 2 HOUR);

which will give you an EST date result. For a result in PST, you would do:


SELECT DATE_SUB(NOW(), INTERVAL 1 HOUR);

If you are working with time in seconds instead of dates, then factor in the offset in seconds. Because there are 3600 seconds in an hour, and EST is 2 hours later than MST, the following converts timestamps from MST to EST:


SELECT unix_timestamp() + (3600 * 2);

SELECT FROM_UNIXTIME(UNIX_TIMESTAMP() + (3600 * 2));

See the MySQL Manual's Date and Time Functions for more information.

Depending on your application, you may also need to do one of the following (but not both):

1. Find every place in your code where a date or time is displayed to the browser and have a user defined function change it to add or subtract the appropriate number of hours before displaying it.

2. Find every place in your code where dates or times are input into your system and have a user defined function add or subtract the appropriate number of hours before storing it.

php技術How do I change MySQL timezone?,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 欧美一区成人 | 免费黄网站在线观看 | 午夜一区二区三区 | 久久久久一区二区三区 | 亚洲国产精品日本 | 久久精品 | 久久久国产一区 | 成人精品国产免费网站 | 欧美激情免费在线 | jdav视频在线观看免费 | 成人免费一区二区三区视频网站 | 国产精品色婷婷久久58 | 97久久超碰| 国产欧美一区二区精品久导航 | 成人a在线 | 国产精品视频一区二区三 | 草草草久久久 | 黄色av大片| 国产精品99久久久久 | 亚洲一区在线日韩在线深爱 | 一区二区高清 | 91国内精品 | 女同久久 | 精品日韩一区二区 | 亚洲一区二区三区视频免费观看 | 中文精品视频 | 成人欧美一区二区三区黑人孕妇 | 一区二区视屏 | 国产黄色在线观看 | 91久久精品一区二区三区 | 黄色在线免费观看 | 欧美久久久电影 | 欧美日韩国产在线 | 国际精品鲁一鲁一区二区小说 | av色站| 欧美成人精品一区二区男人看 | 亚洲国产精品久久久久久 | 国产精品久久久久久一区二区三区 | 久久精品中文字幕 | 国产三级日本三级 | 99re在线视频精品 |