4 ms·
You store the offset or you store the users configuration. Use the users config and/or offset to convert it from UTC. There should be a way to account for DST.
by wil421 7y ago
You store the offset or you store the users configuration. Use the users config and/or offset to convert it from UTC. There should be a way to account for DST. I’ll look into it when I get a chance.
If the future date was input in EDT or EST you’d know what to do in the future when you convert back to either EDT or EST based on the time of year.
- wvenable 7y agoYou can do a lot of things but, at some point, you have to ask yourself if the solution is signficantly more complex than storing local time and the timezone. You also need to be aware that timezones change; even now there are discussions about eliminating daylight saving time in various regions. If you store 4:00pm on Nov 25th and convert that to UTC based on the timezone rules as they exist today, you'll be wrong when you convert them back under different timezone rules. There's just no way to do that cleanly. There are also things to consider: if the user changes their own timezone (by moving) did they intend the value of that time to change (4:00pm is now 1:00pm because it's a WebEx and they moved East) or did they intend that to remain at 4:00pm (it's when they take their medicine every day).