Re: Multiple timezones
Re: Multiple timezones
- Subject: Re: Multiple timezones
- From: Paul Hoadley via Webobjects-dev <email@hidden>
- Date: Wed, 26 Feb 2020 08:56:42 +1030
Hi Michael,
On 26 Feb 2020, at 04:29, Michael Kondratov via Webobjects-dev
<email@hidden> wrote:
> Whats the winning strategy on dealing with users / records in multiple
> timezones? We are starting add add companies that are few hours away from us
> and don't know how to best handle it.
Our approach is something like this:
1. Confirm that you actually need to handle timezones. Sometimes you do, and
sometimes you're stuck with legacy design decisions, but if you don't, then
types like java.time.LocalDate, java.time.LocalDateTime and friends have been
fully supported in ERPrototypes.framework for a while now.
2. Ensure that you know the relevant local timezone for the user. This might be
as simple as dropping an ERXTimeZoneDetector in your page wrapper component,
which will pull the time zone from the user's browser and store it in the
Session. Or maybe you need an organisation-wide timezone selected for groups of
users. This step will be application dependent.
3. Once you've got 2, use that to convert times from local into UTC on the way
into the database, and from UTC to local on the way back out. The local
timezones on either side of that process might not be the same—they will vary
with your solution to 2 above—but you'll always be talking about the same
instant in time, stored in the database as UTC.
--
Paul Hoadley
https://logicsquad.net/
https://www.linkedin.com/company/logic-squad/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >Multiple timezones (From: Michael Kondratov via Webobjects-dev <email@hidden>) |