User avatar
micksulley
Posts: 166
Joined: Sat Mar 03, 2012 11:48 am
Location: Melton Mowbray, England

MySQL sysdate timezone

Fri Apr 05, 2013 7:17 pm

I am developing something on my Pi running latest Raspbian using Python and MySQL and I have a problem with local time. I am in the UK so currently on BST.

My system time shows in BST (type 'date' in terminal)
MySQL shows time in GMT (select now() or select sysdate() )

I find this confusing as I have a similar setup on a different machine, not a Pi but still running Debian, and that displays the correct time everywhere.

Any ideas how I can fix this?
Thanks
Mick

-rst-
Posts: 1316
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland

Re: MySQL sysdate timezone

Tue Apr 09, 2013 3:31 pm

Which versions of MySQL? Maybe you started the MySQL server before daylight saving started - it got the then system timezone and did not update it since:
The system time zone. When the server starts, it attempts to determine the time zone of the host machine and uses it to set the system_time_zone system variable. The value does not change thereafter.
https://dev.mysql.com/doc/refman/4.1/en ... pport.html
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'

Return to “General programming discussion”