0

My understanding was:

  • everything is UTC internally
  • dates are displayed in @@session.time_zone timezone for current session
  • if I do INSERT with +02:00 TZ set and insert 2015-05-15 10:54 it is parsed and stored as 2015-05-15 08:54 UTC.
  • when I change to UTC TZ it should now display 2015-05-15 08:54
  • what happens instead is that it still displays 2015-05-15 10:54

What am I doing wrong? Or is this expected? I read quite some articles about datetime in MySQL but I am still not sure.

2
  • What exactly do you change to UTC at step 4?
    – Kondybas
    May 15, 2015 at 9:24
  • The DB has Etc/UTC (time zone is set to SYSTEM and system has Etc/UTC) by default so I connect again (without setting @@session.time_zone). May 15, 2015 at 11:34

1 Answer 1

2

That only applies to TIMESTAMP fields. DATETIME fields are left as-is.

See http://dev.mysql.com/doc/refman/5.7/en/datetime.html

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .