Hi, I ask if Wappler’s UTC should be the same as GMT because, in my app, whenever a user logs on, I update the User row with a Local and a UTC datetime. Then I have a database view to calc my timezone from the difference between the 2 dates, in hours. Not saying this is the best way to go, just a way.
Anyway, what I have found is that the Local Time in the database is correct, but the UTC is 4 hours out compared to GMT. Not sure if this matters, just not what I was expecting.
These two screen shots are taken a minute apart, and by the way, my timezone should be +8hrs not +12hrs as is calculated.
Values stored in mySQL after an Update following a Login.
GMT according to Google
Does anyone else get this?
I almost think that this does not matter so long as the UTC is consistent from any place in the world. Your thoughts?
UTC and GMT are the same timezones. The UTC/GMT time is determined by using the timezone that is configured. Depending on where you request the UTC time it can be different, normally the timezone is configured in the OS, but PHP, NodeJS and Databases also have there own configurations to set the timezone. Also when sending the local time from a client could make a difference when they are in a different timezone then the server.
So how do you set the UTC datetime field and how is the timezone configured on your server?
Thanks for the thought. On reflection, I though that UTC was supposed to be an absolute time, not dependent on any timezone. At any point of time the UTC would be the same all over the world, as it is when you google Greenwich GMT. Therefore me ‘correcting’ my web host time zone should not have ‘corrected’ the NOW_UTC that wappler generates. In other words, Wappler’s NOW_UTC should agree with GMT, no matter what. Does this make sense?
Anthony, it has taken me a while to get around to this test, but it seems that daylight saving in england does not affect this answer. As of writing this GMT is 3.31pm and London local time is 4.41pm. When I logon to my app I get 15:41 in my DB, so all is good with my method above.