Django: time zone issue

后端 未结 4 1642
一整个雨季
一整个雨季 2021-02-01 09:44

NOTE: I deleted the question as it existed previously and providing only the relevant info here.

Our database server (RH) has TIME_ZONE = \"Europe/London\" specified. An

4条回答
  •  孤城傲影
    2021-02-01 10:40

    Since you edited the question, I'll edit my answer :) Django cannot control the time zone of your db, so the way to fix this is to update the time zone for your db. For MySql, run this query:

    SELECT @@global.time_zone, @@session.time_zone;

    This should return SYSTEM, SYSTEM by default, which in your case means "Europe/London", and the cause of your problem. Now that you've verified this, follow the instructions in the first comment on this page:

    http://dev.mysql.com/doc/refman/5.5/en/time-zone-support.html

    Remember to restart MySql server after you've updated the time zone for the changes to take effect.

提交回复
热议问题