一区二区久久-一区二区三区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技術(shù)How do I change MySQL timezone?,轉(zhuǎn)載需保留來源!

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

主站蜘蛛池模板: 国产在线观看中文字幕 | 久久久夜色精品国产噜噜 | 亚洲国产成人在线观看 | 久久久久久九九 | 日韩久久久精品中文字幕 | 久久综合九九亚洲一区 | 国产精品毛片一区二区三区 | 青青在线精品 | 精品国产96亚洲一区二区三区 | 成人a毛片手机免费播放 | 日本高清视频wwww色 | 国产美女在线看 | 精品国产一区二区三区在线 | 超清乱人伦中文视频在线 | 中文精品久久久久国产网址 | 美女一级ba大片免色无遮住 | 最新国产福利在线观看 | 免费看黄网站在线 | 日本欧美一区二区三区视频 | 中文字幕一区二区三区视频在线 | 午夜小视频免费 | 国产成人综合一区精品 | 国产欧美激情一区二区三区 | 精品少妇一区二区三区视频 | 日本理论午夜中文字幕第一页 | 免费小视频在线观看 | 欧美私人网站 | 黄色的视频网站 | 日韩在线一区二区三区免费视频 | 国产大片中文字幕在线观看 | 91免费公开视频 | 在线精品国产成人综合第一页 | 国产精品一二三区 | 97影院秋霞国产精品 | 精品国产欧美精品v | 午夜国产福利在线观看 | 91区国产福利在线观看午夜 | 亚洲最大的视频网站 | 69国产成人综合久久精 | 一级a性色生活片久久毛片 一级爱爱片一级毛片-一毛 | 一本久久道|