一区二区久久-一区二区三区www-一区二区三区久久-一区二区三区久久精品-麻豆国产一区二区在线观看-麻豆国产视频

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?,轉(zhuǎn)載需保留來源!

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

主站蜘蛛池模板: 永久黄网站色视频免费观看 | 日日摸人人看97人人澡 | 国产中文字幕乱人伦在线观看 | 色婷婷精品大全在线视频 | 丁香六月综合网 | 久久久久一 | 欧美成人第一页 | 久久综合伊人 | 国产图片综合区 | 亚洲综合色视频 | 激情综合五月婷婷 | 国产在线精品观看 | 国产成人免费a在线资源 | 日韩精品一区二区三区中文在线 | 免费在线观看黄视频 | 黄网免费观看 | 国产精品成人观看视频网站 | 久久99精品久久久久久青青91 | 色性综合 | 在线观看国产小视频 | 免费看一级淫片成人 | 久久网综合 | 国产女人在线 | 亚洲激情综合在线 | 亚洲人欧洲日韩 | 久久中文字幕免费 | www.国产视频 | 精品国产成人a在线观看 | 国产精品视频李雅 | 日本一区二区三区四区公司 | 精品麻豆视频 | 久久国产精品偷 | porn成人毛片| 五月婷婷 六月丁香 | 国产在线免 | 亚洲国产精品久久久天堂麻豆 | 毛片黄片免费看 | 久久机热这里只有精品无需 | 看全色黄大色黄大片色责看的 | 欧美在线视频在线观看 | 色欧美视频 |