Re: [Pharo-users] Working with timezones
Esteban wrote:
Anyhow this is too much to add to my app without giving it proper thinking. So let's KISS.
If you only work with a single server/all servers in the same timezone that translates to: - Do everything in local time or UTC, have one place where you know your zone, - Store all time/date without timezone. - Have in your session timezone information you get from the browser. - Store in the user info their preferred/last used timezone - Translate on the outside Stephan
Exactly ! On 11 Jul 2014, at 11:26, Stephan Eggermont <stephan@stack.nl> wrote:
Esteban wrote:
Anyhow this is too much to add to my app without giving it proper thinking. So let's KISS.
If you only work with a single server/all servers in the same timezone that translates to: - Do everything in local time or UTC, have one place where you know your zone, - Store all time/date without timezone. - Have in your session timezone information you get from the browser. - Store in the user info their preferred/last used timezone - Translate on the outside
Stephan
Additionally I think its helpful to remember that timezones are political constructs and so are completely arbitrary and open to change based on the whims of political leaders e.g. https://en.wikipedia.org/wiki/Time_in_Russia#Daylight_saving_time So best keep them out of your code, near the presentation layer, as much as possible as Stephan recommends. Stephan Eggermont wrote
Esteban wrote:
Anyhow this is too much to add to my app without giving it proper thinking. So let's KISS.
If you only work with a single server/all servers in the same timezone that translates to: - Do everything in local time or UTC, have one place where you know your zone, - Store all time/date without timezone. - Have in your session timezone information you get from the browser. - Store in the user info their preferred/last used timezone - Translate on the outside
Stephan
-- View this message in context: http://forum.world.st/Working-with-timezones-tp4767466p4767553.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
2014-07-11 13:30 GMT-03:00 Paul DeBruicker <pdebruic@gmail.com>:
Additionally I think its helpful to remember that timezones are political constructs and so are completely arbitrary and open to change based on the whims of political leaders e.g.
https://en.wikipedia.org/wiki/Time_in_Russia#Daylight_saving_time
So best keep them out of your code, near the presentation layer, as much as possible as Stephan recommends.
Yeap, and using UTC whenever possible to have a "zero" point of reference. Even when using a predefined time offset would be possible. After reading W3's TR I mentioned before, I learnt there is a reason to store timezone information if you have to deal with dates and times in the future when using incremental time representations (like the ones used by most systems). In such case a change in DST. Regards, Esteban A. Maringolo
participants (4)
-
Esteban A. Maringolo -
Paul DeBruicker -
Stephan Eggermont -
Sven Van Caekenberghe