Bug 23950 - TimeZone.CurrentTimeZone.GetDaylightChanges contains the wrong End value for AEDT
Summary: TimeZone.CurrentTimeZone.GetDaylightChanges contains the wrong End value for ...
Status: VERIFIED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 4.18.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: 4.18.1
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2014-10-20 18:11 UTC by Peter Collins
Modified: 2014-10-27 13:20 UTC (History)
5 users (show)

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


Attachments
AEDT.png (477.40 KB, image/png)
2014-10-23 12:29 UTC, Jonathan Pryor
Details


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 Peter Collins 2014-10-20 18:11:03 UTC
This issue likely effects all time zones that begin at the end of one year, and span into the next. It appears that the End value being returned on Android is the value that should be returned for the _next_ year, not the current one.

Repro (requires current tz to be set to AEST, e.g. Sydney):
> var tz = TimeZone.CurrentTimeZone.GetDaylightChanges (2014);
> Console.WriteLine ("dst: " + dst.Start.ToString ("g") + " -> " + dst.End.ToString ("g"));

c# console project output:
> dst: 10/5/2014 2:00 AM -> 4/6/2014 3:00 AM

android project output:
> dst: 10/5/2014 12:00 AM -> 4/5/2014 12:00 AM


Environment:
OSX Yosemite / Australian Eastern Time
XA master / f6fc4576
Comment 1 Udham Singh 2014-10-21 04:35:33 UTC
I have checked this issue with the help of instructions provided in bug description and  below are my observations.

C# console project output:
> dst: 05-10-2014 02:00 -> 06-04-2014 03:00

Android project output:
> dst: 01/01/2014 00:00 -> 05/04/2014 00:00

Screencast : http://www.screencast.com/t/YDvf1wQn

Note : Checked with 'Australian Eastern Daylight Time (Sydney)'.

Environment Info :

=== Xamarin Studio ===

Version 5.5.2 (build 3)
Installation UUID: 0b7eaebc-a0ed-4b58-81df-91e378cad28c
Runtime:
	Mono 3.10.0 ((detached/e204655)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 310000023

=== Apple Developer Tools ===

Xcode 6.1 (6602)
Build 6A1052c

=== Xamarin.Android ===

Version: 4.18.0 (Starter Edition)
Android SDK: /Users/Admin_Mac/Desktop/Anddk/android-sdk-macosx
	Supported Android versions:
		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)
		4.4.87 (API level 20)
		4.5    (API level 21)
Java SDK: /usr
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)

=== Build Information ===

Release ID: 505020003
Git revision: 6d4c806e383ba366b15fbccca9ddc1ba94f8d5ad
Build date: 2014-10-15 15:00:36-04
Xamarin addins: 069ddd29bb70a42238142eee9bac21a5e4b2f9f9

=== Operating System ===

Mac OS X 10.10.0
Darwin Admin-Macs-Mac-mini.local 14.0.0 Darwin Kernel Version 14.0.0
    Fri Sep 19 00:26:44 PDT 2014
    root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64
Comment 2 Peter Collins 2014-10-21 16:40:38 UTC
This is a regression from a previously stable XA 4.14.
Comment 3 Jonathan Pryor 2014-10-23 12:29:37 UTC
Created attachment 8483 [details]
AEDT.png

Current screenshot of http://www.timeanddate.com/library/abbreviations/timezones/au/edt.html
Comment 4 Jonathan Pryor 2014-10-23 12:32:02 UTC
@PeterC: I suspect you've actually found a desktop Mono bug. Or something.

May I direct you to:

http://www.timeanddate.com/library/abbreviations/timezones/au/edt.html
Attachment #8483 [details].

In the top-right, it states:

> Sydney will stay on AEDT until Sunday, April 5, 2015 at 3:00 AM
> when clocks are moved to Sunday, April 5, 2015 at 02:00:00AEST

Notice that "April 5, 2015 at 3:00 AM" is *exactly* what Xamarin.Android returns (after monodroid/8b57fd84 / Bug #23949):

> dst: 10/5/2014 2:00 AM -> 4/5/2014 3:00 AM

Thus, AFAICT Xamarin.Android is providing correct information, and this bug is invalid.
Comment 5 Jonathan Pryor 2014-10-23 15:24:12 UTC
My analysis in Comment #4 is incorrect; .NET uses the year provided to TimeZone.GetDaylightChanges() for both the start and end dates, which we weren't doing.

Fixed in monodroid/38adb0ef.
Comment 6 Mohit Kheterpal 2014-10-27 13:20:34 UTC
I have checked this issue with XA 4.18.1.1 and I am getting following output :

for console app
dst: 05-10-2014 02:00 -> 06-04-2014 03:00

for android app
dst: 05/10/2014 02:00 -> 06/04/2014 03:00

the output is same in both console and android app after using code in bug description.

Hence closing this issue.