中文字幕日韩一区二区_国产一区二区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?,轉載需保留來源!

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

主站蜘蛛池模板: 国产一级在线视频 | 国产视频一视频二 | 一级片片 | 九九99九九精彩46 | 91资源在线 | 特级黄一级播放 | 就操在线 | 日韩成人在线电影 | 成人性视频免费网站 | 国产一区二 | 日韩毛片在线免费观看 | 国产日韩欧美精品一区二区 | 在线欧美亚洲 | 国产成人精品一区二 | 国精产品一品二品国精在线观看 | 一区二区三区四区免费视频 | 欧美激情视频一区二区三区在线播放 | 久久久国产精品视频 | 日韩成人在线免费观看 | 亚洲精品乱码久久久久v最新版 | 可以免费看的毛片 | 欧美一区免费 | 日本精品视频 | 精品国产一区二区三区性色av | 天天爽夜夜操 | 激情91| 日韩高清一区 | 久久久久久色 | 99久久精品免费 | 久久久久久国产免费视网址 | 国产成人免费视频网站高清观看视频 | 日韩欧美在线不卡 | 中文字幕一区二区三区在线视频 | 国产高清在线精品 | 激情伊人网 | 日本福利片 | 中文字幕在线免费视频 | 欧美精产国品一二三区 | 久久精品久久久久久 | 成人久久 | 日本污视频 |