Re: Possible issue in timzoneinfo class with mono

nikhil sehgal <[email protected]>
Newsgroups gmane.comp.gnome.mono.devel
Message-ID <CAF0vV7wxPkwAH-Utf70qiEJDMbo1O-REcYRTkADiSLEf_gK-2A__44756.6104158342$1485972195$gmane$org@mail.gmail.com>
Thanks ....

On Jan 31, 2017 6:37 PM, "Marek Safar" <[email protected]> wrote:

> Hi Nikhil,
>
>
>> I have raised two bugs(51794
>> <https://bugzilla.xamarin.com/show_bug.cgi?id=51794>) & (51795)
>> <https://bugzilla.xamarin.com/show_bug.cgi?id=51795>for the same .I
>> haven't got any response .Please Help .
>>
>
> Thanks for doing that. We have long term plans to replace TimeZoneInfo
> with CoreRT implementation
> which should also resolve your issues but if you need something short term
> the best is to try to fix it
> yourself and send us PR.
>
> Marek
>
>
> On Thu, Jan 26, 2017 at 6:33 PM, Marek Safar <[email protected]>
>> wrote:
>>
>>> Hello,
>>>
>>> Could you please fill a bug report with steps how to reproduce it at
>>> http://bugzilla.xamarin.com/
>>>
>>> Thank you
>>> Marek
>>>
>>> On Thu, Jan 26, 2017 at 1:03 AM, nikhil sehgal <[email protected]>
>>> wrote:
>>>
>>>> *Currently we have 2 issues while implementing TimeZoneInfo class in
>>>> MONO.*
>>>>
>>>> 1.       While fetching the currenttimezone using “TimeZoneInfo.Local”
>>>> we are getting the value of “DisplayName” and “ID” as *Local* in
>>>> Linux, while it is giving correct values in Windows implementation.
>>>>
>>>>
>>>> [image: Inline image 1]
>>>>
>>>>
>>>> 1.
>>>>
>>>>
>>>>
>>>> TimeZoneInfo TZI_Local = TimeZoneInfo.Local;
>>>>
>>>>               string DisplayName = TZI_Local.DisplayName;
>>>>
>>>>               string Id = TZI_Local.Id;
>>>>
>>>> Console.WriteLine("Display Name : " + DisplayName);
>>>>
>>>>               Console.WriteLine("ID : " + Id);
>>>>
>>>>
>>>>
>>>> However when we fetch out all the TimeZone data we can have the value
>>>> for “DisplayName” and “ID” in Linux but that too is different from that of
>>>> Windows OS.
>>>>
>>>> System.Collections.ObjectModel.ReadOnlyCollection<TimeZoneInfo> tz;
>>>>
>>>>               tz = TimeZoneInfo.GetSystemTimeZones();
>>>>
>>>>               foreach (TimeZoneInfo timeZone in tz)
>>>>
>>>>               {
>>>>
>>>>                      string DisplayName = timeZone.DisplayName;
>>>>
>>>>                      string Id = timeZone.Id;
>>>>
>>>> Console.WriteLine("Display Name : " + DisplayName);
>>>>
>>>>                      Console.WriteLine("ID : " + Id);
>>>>
>>>> }
>>>>
>>>>
>>>>
>>>> *Output in Linux*
>>>>
>>>> DisplayName : Asia/Tehran
>>>>
>>>> ID : Asia/Tehran
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> 2.       When we look into Adjustment Rules (TimeZoneInfo.
>>>> AdjustmentRule) for the calculation of DSTDate and STDDate again this
>>>> 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());
>>>>
>>>> }
>>>>
>>>> [image: Inline image 2]
>>>>
>>>> _______________________________________________
>>>> Mono-devel-list mailing list
>>>> [email protected]
>>>> http://lists.dot.net/mailman/listinfo/mono-devel-list
>>>>
>>>>
>>>
>>
>>
>> --
>> Thanks & Regards
>> NIkhil Sehgal
>> Mobile No 9711855929
>> Email Id [email protected]
>> Skype ID sehgal.nikhil
>>
>
>

_______________________________________________
Mono-devel-list mailing list
[email protected]
http://lists.dot.net/mailman/listinfo/mono-devel-list
image.png (image/png, 262.4 KB) - not displayed
image.png (image/png, 272.1 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.