gunter Posted January 9, 2019 Share Posted January 9, 2019 let´s think about an appointment scheduling website... It´s about meeting personally - making an appointment with the hairdresser, massage therapist... is it possible to ignore the timezone? Is it possible to store an appointment (10:00 till 11:00) so it is saved and viewable forever correctly, even if the server time setting is wrong? And just using the timezone to decide when a reminder email has to be sent? Once I was invited by friend from another country who made an facebook event to meet during his travel in my town with some friends... at 6 pm... and then there was nobody there because they real beginning was at 7 pm... because he was in another timezone when he created the event and facebook thought... ah... different timezone... lets subtract an hour to the beginning of the event... * Link to comment Share on other sites More sharing options...
LostKobrakai Posted January 9, 2019 Share Posted January 9, 2019 You're talking about wall-time. To be really save for future dates you need to store not only the datetime (UTC) + timezone, but also the wall time. There are changes in timezones multiple times per year and some are even countries changing how their timezones work. If you have both UTC and wall-time you can detect such changes and react accordingly. The UTC time you need as soon as you need to compare / act on times, which are in multiple timezones, you need to interact with some APIs or export .ics calendar files. So for your examples it might be fine to disregard the timezone and only use wall-time. Here's some more information on why timezones are hard: https://zachholman.com/talk/utc-is-enough-for-everyone-right I've also found this to be a good blog with a bit more actionable advice: http://www.creativedeletion.com/ 7 1 Link to comment Share on other sites More sharing options...
gunter Posted January 9, 2019 Author Share Posted January 9, 2019 thank you! wall time made it more clear for me! This is a nice page about time! Link to comment Share on other sites More sharing options...
ottogal Posted January 9, 2019 Share Posted January 9, 2019 5 hours ago, LostKobrakai said: Here's some more information on why timezones are hard: https://zachholman.com/talk/utc-is-enough-for-everyone-right I've also found this to be a good blog with a bit more actionable advice: http://www.creativedeletion.com/ Very interesting sites, thank you! Link to comment Share on other sites More sharing options...
gunter Posted January 13, 2019 Author Share Posted January 13, 2019 Are you using normally just strtotime and time for your date/time calculations???? Because pw uses them for the datetime fieldtype? Or addionally the datetime class? * Because I just made a small calendar module, which uses datetime... but now I´m thinking about, if this was a good idea... Link to comment Share on other sites More sharing options...
LostKobrakai Posted January 13, 2019 Share Posted January 13, 2019 I don't particularly like the handling of datetimes in processwire very much. Imho the unformatted value of those should be a proper DateTime object if not carbon. Link to comment Share on other sites More sharing options...
gunter Posted January 14, 2019 Author Share Posted January 14, 2019 Thank you, LostKobrakai! Link to comment Share on other sites More sharing options...
Recommended Posts