Bug 17155 - TimeZoneInfo.ConvertTime adjustment rules aren't considered between Jan 1st and DateEnd.
Summary: TimeZoneInfo.ConvertTime adjustment rules aren't considered between Jan 1st a...
Status: VERIFIED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: BCL Class Libraries ()
Version: 4.2.x
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Marek Habersack
URL:
Depends on:
Blocks:
 
Reported: 2014-01-09 18:07 UTC by Le-roy Staines
Modified: 2014-06-03 15:03 UTC (History)
5 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED FIXED

Description Le-roy Staines 2014-01-09 18:07:55 UTC
Once the new year rolls over then DST adjustments no longer effective until the next 'DateStart' adjustment.

Example:

TimeZoneInfo tz = TimeZoneInfo.FindSystemTimeZoneById("Pacific/Auckland");
DateTime sourceDT = new DateTime(2014,1,9,23,0,0,DateTimeKind.Utc);
DateTime outputDT = TimeZoneInfo.ConvertTime(sourceDT, tz);

Output:
11am on 10th January 2014

EXPECTED OUTPUT:
12pm (noon) on 10th January 2014

If you run it at the end of december it works fine but as soon as you go to the january-side of the adjustment rule it fails. And it fails consistently with every year of the adjustment rules.
Comment 1 Marek Habersack 2014-04-23 11:33:20 UTC
Fixed in the master branch with commit 5cafbaac447bbd07d157c9453ab645833af73eec

It was a BCL (TimeZoneInfo bug) fixed in the following mono commits:

  https://github.com/mono/mono/commit/44c0689534a05451c29b6c917bb4a807415c1529
  https://github.com/mono/mono/commit/3df23604a43608bbf29edb88abecf7150b21bda1
Comment 2 Udham Singh 2014-06-03 15:03:42 UTC
I have checked this issue and this is working fine now, as shown in the screencast : http://screencast.com/t/xheRUAeo

Hence closing this issue.

Environment Info :

=== Xamarin Studio ===

Version 5.1 (build 302)
Installation UUID: 3b924754-5196-440a-b42b-05ebb3a3082e
Runtime:
	Microsoft .NET 4.0.30319.18408
	GTK+ 2.24.22 (MS-Windows theme)
	GTK# 2.12.25

=== Xamarin.Android ===

Version: 4.13.0 (Enterprise Edition)
Android SDK: E:\AndroidSDK
	Supported Android versions:
		1.6   (API level 4)
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		3.2   (API level 13)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.2   (API level 17)
		4.3   (API level 18)
		4.4   (API level 19)
Java SDK: C:\Program Files\Java\jdk1.6.0_31
java version "1.6.0_31"
Java(TM) SE Runtime Environment (build 1.6.0_31-b05)
Java HotSpot(TM) Client VM (build 20.6-b01, mixed mode, sharing)

=== Build Information ===

Release ID: 501000302
Git revision: 37edec4110ed93f02581f1331d2ff5b38f9a3aa9
Build date: 2014-05-30 12:45:30-04
Xamarin addins: b4105598b2afb41dac2f91a523ce94dbb3f1efdf

=== Operating System ===

Windows 6.1.7601.65536