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 (show other bugs)
Version: 4.6.0 (C8)
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-01-26 18:52 UTC by Nikhil
Modified: 2017-01-30 04:00 UTC (History)
1 user (show)

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


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

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

Note You need to log in before you can comment on or make changes to this bug.