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

Take DST into account when converting a calendar into its items #359

Merged
merged 1 commit into from
Oct 9, 2019

Conversation

badboy
Copy link
Member

@badboy badboy commented Oct 8, 2019

ZONE_OFFSET only provides the default offset from UTC without DST considerations.
DST_OFFSET needs to be added to get the full offset for the calendar instance.

There's a very small hint in the deprecated Date class that one
needs to do this1.

Neither the docs for ZONE_OFFSET2 nor the ones for DST_OFFSET3
mention this explicitly.
I guess the existence of both fields is the only indicator there.

ZONE_OFFSET only provides the default offset from UTC without DST considerations.
DST_OFFSET needs to be added to get the full offset for the calendar instance.

There's a _very small_ hint in the deprecated `Date` class that one
needs to do this[1].

Neither the docs for ZONE_OFFSET[2] nor the ones for DST_OFFSET[3]
mention this explicitly.
I guess the existence of both fields is the only indicator there.

[1]: https://docs.oracle.com/javase/7/docs/api/java/util/Date.html#getTimezoneOffset()
[2]: https://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html#ZONE_OFFSET
[3]: https://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html#DST_OFFSET
@codecov-io
Copy link

codecov-io commented Oct 8, 2019

Codecov Report

Merging #359 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #359      +/-   ##
============================================
+ Coverage      75.2%   75.24%   +0.03%     
- Complexity      307      309       +2     
============================================
  Files            92       92              
  Lines          5182     5182              
  Branches        632      632              
============================================
+ Hits           3897     3899       +2     
+ Misses          824      822       -2     
  Partials        461      461
Impacted Files Coverage Δ Complexity Δ
...illa/telemetry/glean/private/DatetimeMetricType.kt 92.06% <100%> (+3.17%) 14 <0> (+2) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 76a3be9...2e3c3c7. Read the comment docs.

@badboy badboy merged commit 00f47d6 into master Oct 9, 2019
@badboy badboy deleted the timezones-they-are-at-it-again branch October 9, 2019 08:47
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.

5 participants