← Back to team overview

dhis2-devs-core team mailing list archive

Re: DST and TZ best practices

 

Thanks. I still think that we need to store all dates in the server
timezone in the db. For implementations with just one timezone (e.g. one
country) then this is obviously not a problem.

For global implementations in multiple timezones (world-wide
implementations) I think the server timezone should be set to UTC time.
Then I think to handle this properly we need a setting per user to indicate
the timezone she is in. We could then read in the user setting on the
server and convert dates that are supplied in web requests to UTC/server
time. For responses we could do the same - read the user setting and
convert from UTC to the user's timezone.

I think we need to store all dates on the server in a standard timezone due
to analytics/queries. E.g. it must be possible for a user in UTC +5 to ask
for the total number of events on Monday July 1, where the events were
entered by another user in UTC -4. I.e. we cannot have different
understanding of dates across the system for aggregation/statistic purposes.

Note I am no guru on this but I think it will work. What do you think?






On Wed, Dec 2, 2015 at 11:04 AM, Morten Olav Hansen <mortenoh@xxxxxxxxx>
wrote:

>
> http://stackoverflow.com/questions/2532729/daylight-saving-time-and-time-zone-best-practices
>
> --
> Morten
>
> --
> Mailing list: https://launchpad.net/~dhis2-devs-core
> Post to     : dhis2-devs-core@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs-core
> More help   : https://help.launchpad.net/ListHelp
>
>


-- 
Lars Helge Øverland
Lead developer, DHIS 2
University of Oslo
Skype: larshelgeoverland
http://www.dhis2.org <https://www.dhis2.org>

Follow ups

References