Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use London timezone #320

Merged
merged 1 commit into from Apr 11, 2017
Merged

Use London timezone #320

merged 1 commit into from Apr 11, 2017

Conversation

fofr
Copy link
Contributor

@fofr fofr commented Apr 10, 2017

Most dates in content items are UTC, occasionally some are BST. Any UTC dates during daylight savings time would render an hour out – when the time is around midnight, then the date will also be wrong.

How bug appeared

via https://govuk.zendesk.com/agent/tickets/2044273
On: https://www.gov.uk/government/publications/your-new-state-pension-explained

"public_updated_at": "2017-04-09T23:15:05.000+00:00",
"public_timestamp": "2017-04-10T00:15:05.000+01:00",

Those two dates are the same when taking into account time zone. But they rendered as:
screen shot 2017-04-10 at 13 52 44

Fix

  • Use London timezone
  • Update all uses of Time.parse to Time.zone.parse
  • Replace most uses of DateTime.parse with Time.zone.parse
  • Fix tests now they correctly handle the daylight savings time (DST)
  • Include comment about far future dates having no DST
  • Update tests to use times in November in GMT, not BST (this has
    highlighted an odd usage of daylight savings timezones during a non DST
    time period in the content schema examples – e.g. 4 Nov is in BST, but
    that’s not in a DST period)

Most dates in content items are UTC, occasionally some are BST. Any UTC
dates during daylight savings time would render an hour out – when the
time is around midnight, then the date will also be wrong:
https://govuk.zendesk.com/agent/tickets/2044273

* Use London timezone
* Update all uses of Time.parse to Time.zone.parse
* Replace DateTime.parse with Time.zone.parse
* Fix tests now they correctly handle the daylight savings time (DST)
* Include comment about far future dates having no DST
* Update tests to use times in November in GMT, not BST (this has
highlighted an odd usage of daylight savings timezones during a non DST
time period in the content schema examples – e.g. 4 Nov is in BST, but
that’s not in a DST period)
@boffbowsh boffbowsh temporarily deployed to government-frontend-pr-320 April 10, 2017 13:02 Inactive
@NickColley
Copy link
Contributor

This looks great 👍

@fofr fofr merged commit d3a7e23 into master Apr 11, 2017
@fofr fofr deleted the timezones branch April 11, 2017 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants