Created
December 10, 2014 08:56
-
-
Save tanakahisateru/15488cfd13a4fc9bf9ee to your computer and use it in GitHub Desktop.
日本のクリスマスは世界のクリスマスイブ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE test ( | |
day1 DATETIME, | |
day2 TIMESTAMP | |
); | |
SET SESSION time_zone = 'UTC'; | |
INSERT INTO test VALUES ('2014-12-25 00:00:00', '2014-12-25 00:00:00'); | |
SET SESSION time_zone = 'Asia/Tokyo'; | |
INSERT INTO test VALUES ('2014-12-25 00:00:00', '2014-12-25 00:00:00'); | |
SET SESSION time_zone = 'UTC'; | |
SELECT * FROM test; | |
-- day1 day2 | |
-- 2014-12-25 00:00:00 2014-12-25 00:00:00 | |
-- 2014-12-25 00:00:00 2014-12-24 15:00:00 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
さらにアプリケーションで受けたときもうDBの型失われてる問題。
ユーザーのロケールによって時差補正するとかどうしたら...