Bug 51795 - TimeZoneInfo.AdjustmentRule retrun -1 for "Week” and “DayofWeek" & values for “Day”, ”Hour”, ”Minute” and “Second” are not same in Linux and Windows.
Summary: TimeZoneInfo.AdjustmentRule retrun -1 for "Week” and “DayofWeek" & values for...
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: System ()
Version: 4.6.0 (C8)
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2017-01-26 18:52 UTC by Nikhil
Modified: 2017-01-30 04:00 UTC (History)
1 user (show)

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

Screenshot on Linux and Windows (272.11 KB, image/png)
2017-01-26 18:52 UTC, Nikhil

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 for Bug 51795 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description Nikhil 2017-01-26 18:52:34 UTC
Created attachment 19495 [details]
Screenshot on Linux and Windows

Adjustment Rules (TimeZoneInfo.AdjustmentRule) class returns -1 for “Week” and “DayofWeek”. Also the other values e.g. “Day”, ”Hour”, ”Minute” and “Second” are not same in Linux and Windows.

TimeZoneInfo TZI_Local = TimeZoneInfo.Local;

TimeZoneInfo.AdjustmentRule[] ar = TZI_Local.GetAdjustmentRules();

foreach (TimeZoneInfo.AdjustmentRule tzi_ar in ar)


Console.WriteLine("DaylightTransitionEnd.Day : " + tzi_ar.DaylightTransitionEnd.Day.ToString());
              Console.WriteLine("DaylightTransitionEnd.DayOfWeek : " + tzi_ar.DaylightTransitionEnd.DayOfWeek.ToString());
              Console.WriteLine("DaylightTransitionEnd.Month : " + tzi_ar.DaylightTransitionEnd.Month.ToString());
              Console.WriteLine("DaylightTransitionEnd.Week : " + tzi_ar.DaylightTransitionEnd.Week.ToString());
Console.WriteLine("DaylightTransitionEnd.TimeOfDay.Hour : " + tzi_ar.DaylightTransitionEnd.TimeOfDay.Hour.ToString());
Console.WriteLine("DaylightTransitionEnd.TimeOfDay.Minute : " + tzi_ar.DaylightTransitionEnd.TimeOfDay.Minute.ToString());
       Console.WriteLine("DaylightTransitionEnd.TimeOfDay.Second : " + tzi_ar.DaylightTransitionEnd.TimeOfDay.Second.ToString());

Comment 1 Nikhil 2017-01-30 04:00:49 UTC
Please advice