[mythtv-users] OT mysql datetime

Hika van den Hoven hikavdh at gmail.com
Tue Apr 28 21:59:08 UTC 2015


Hoi Hika,

Tuesday, April 28, 2015, 2:48:48 PM, you wrote:

> Hoi All,

>  I'm working on some new unrelated mysql database and I'm encountering
>  some weird datetime behaviour. I was wondering if any of you could
>  enlighten me. The server is running mysql 5.6.22

>  I've created a new table with both a timestamp and a datetime field.
>  The timestamp field gets filled with local time values. If I use NOW()
>  or CURRENT_TIMESTAMP in an INSERT query I get UTC time?

>  I don't mind in this database which is used, but of cause I want it to
>  be consistent. What am I doing wrong? Both server and the workstation
>  is correctly setup on timezone and running on UTC? I don't think I
>  explicitly set up mysql timezone. It gets it from the system.

I found it. A timestamp field is timezone aware and while saving as
UTC it displays in local time. datetime just saves and shows what you
give it.

Tot mails,
  Hika                            mailto:hikavdh at gmail.com

"Zonder hoop kun je niet leven
Zonder leven is er geen hoop
Het eeuwige dilemma
Zeker als je hoop moet vernietigen om te kunnen overleven!"

De lerende Mens



More information about the mythtv-users mailing list