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

Wrong offset selected for timezones which don't observe DST and have had their UTC offset increased since the beginning of time #378

Closed
mfields3 opened this issue May 3, 2018 · 1 comment

Comments

@mfields3
Copy link

mfields3 commented May 3, 2018

When a timezone is added which does not observe Daylight Savings Time, the minimum UTC offset which was ever used for the timezone is used which can be incorrect if the timezone has ever increased the UTC offset it uses.

For example:

  • A calendar with a timezone of "America/Cayman" reports the offset as -05:19:36 (which was from 01/01/1890 - 22/04/1908). Since 22/04/1908, the correct offset is -05:00:00.
  • A calendar with a timezone of "Asia/Singapore" reports the offset as 06:55:25 (which was from the beginning of time - 31/05/1905). Since 31/12/19818, the correct offset is 08:00:00.
string timezone = "Asia/Singapore";
var iCal = new Ical.Net.Calendar();
iCal.AddTimeZone(timezone);
Console.WriteLine("The reported offset is: " + ((VTimeZoneInfo)iCal.TimeZones[0].Children[0]).OffsetTo);

The issue is because NodaTime treats the current timezone interval as not having an end time. Code at VTimeZone.cs:47 specifically excludes timezone intervals which don't have an end time incorrectly.

mfields3 pushed a commit to mfields3/ical.net that referenced this issue May 3, 2018
mfields3 added a commit to mfields3/ical.net that referenced this issue May 3, 2018
Fix for ical-org#378 - handle timezones which do not observe DST
rianjs added a commit that referenced this issue May 29, 2018
Fix for #378 - handle timezones which do not observe DST
@rianjs
Copy link
Collaborator

rianjs commented May 29, 2018

Will be available in nuget version 4.1.5 in the next hour or so:

https://www.nuget.org/packages/Ical.Net/4.1.5

@rianjs rianjs closed this as completed May 29, 2018
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

No branches or pull requests

2 participants