Ticket #272 (closed enhancement: fixed)

Opened 3 years ago

Last modified 3 years ago

Using GMT time for database times and timezones (fase 1)

Reported by: robert Owned by: robert
Priority: major Milestone: MediaMosa 2.2
Component: Core Version:
Keywords: Cc:
MoSCoW: Must Have Estimated time after impact analysis:
Related to project: none Tested: no
Accepted: no Estimated Hours: 12

Description

We currently insert database dates for created and changed using the server time, which is [CET] (central european time). The problem with [CET] is the difference during summer and winter time. Current (summer) is GMT+0200 and during winter GMT+0100.

Also dates supplied by REST calls are stored as 'is'. Output of dates in REST calls are returned as they are stored. There is no indication on the output in which timezone we return our dates.

This is starting to be a problem because our new admin tools show dates converted from GMT to the timezone of the website. So all times are shown with +0200. We hot-fixed it by setting the timezone in the admin to +0000.

Another problem is that different EGA's can be in different timezones, inserting dates in their timezone. This is not a big problem because the dates are returned as they where supplied. However, if 2 EGA's would share assets/mediafiles and have both different timezones, both EGA's will not receive the correct dates.

To fix this;
We need to store all automated dates like created and changed as GMT.
We need to store all incoming dates from EGA's as GMT, so output dates can be converted into the timezone of the EGA.
Each EGA requires own timezone setting; this timezone is used to convert incoming dates into GMT and outgoing date into the timezone of the EGA.

Impact:
Extra setting EGA.
All output dates needs conversion for dates, like meta-data, created, changed dates.
All input dates needs conversion to GMT.
Needs more study how to convert times from own timezone to GMT and back (code available for converion from GMT to timezone in Drupal 7)

Change History

Changed 3 years ago by Frans

  • moscow changed from Should Have to Must Have
  • milestone changed from MediaMosa X.X to MediaMosa 2.2

Changed 3 years ago by robert

  • estimated_hours set to 8
  • summary changed from Using GMT time for database times and timezones to Using GMT time for database times and timezones (fase 1)

- Solve admin dates into timezone. (fase 1)
- EGA depended timezone setting. (fase 1)
- Store created/changed as UTC. (fase 1?/2)
- Output dates in REST into correct EGA timezone (fase 2).

Changed 3 years ago by robert

  • estimated_hours changed from 8 to 12

Changed 3 years ago by robert

  • owner set to robert
  • status changed from new to assigned

Changed 3 years ago by robert

  • status changed from assigned to closed
  • resolution set to fixed

Changelog copy;

- UTC to application timezone support added; (See MediaMosa ticker #272).
  - All dates from REST POST calls are now converted from application timezone 
    to UTC.
  - All dates in GET REST calls are now converted to dates in the client 
    applications timezone.
  - All dates currently in database are converted to UTC by update script.
  - All dates in migration 1.7->2.x module convert dates to UTC during 
    migration.
  - Ticket has been finished and no longer requires a fase 2 as originally
    intended.
  - All existing client applications have default timezone set to 
    Europe/Amsterdam.
  - Client application form now has the timezone option and is required.
  - If the REST call has no application during the REST call (f.e. 
    external/internal calls), then these will have Europe/Amsterdam timezone.
Note: See TracTickets for help on using tickets.