Bug 31691 - TimeZoneInfo.GetAdjustmentRules() returns an empty array even if SupportsDaylightSavingTime is true
Summary: TimeZoneInfo.GetAdjustmentRules() returns an empty array even if SupportsDayl...
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: mscorlib (show other bugs)
Version: master
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: marcos.henrich
URL:
Depends on:
Blocks:
 
Reported: 2015-07-07 05:40 UTC by af4178a2
Modified: 2015-11-08 08:08 UTC (History)
3 users (show)

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


Attachments

Description af4178a2 2015-07-07 05:40:58 UTC
For some time zones contained in TimeZoneInfo.GetSystemTimeZones() supporting DST the method GetAdjustmentRules() returns an empty array.

The problem has been observed in Mono 4.3.0.292-0nightly1 (from the offical Mono repository) running on Debian Jessie/Linux 3.19.0. The problem did not exist in Mono 3.2.8+dfsg-10 (from the offical Debian repository).


NUnit test code:

[TestFixture]
public sealed class TimeZoneInfoFixture
{
    [Test]
    public void GetAdjustmentRulesWhenSupportsDaylightSavingTime()
    {
        foreach(TimeZoneInfo tz in TimeZoneInfo.GetSystemTimeZones())
        {
            if(tz.SupportsDaylightSavingTime)
                Assert.That(tz.GetAdjustmentRules(), Is.Not.Empty);
        }
    }
}


Similar problem was reported with bug #3333 (https://bugzilla.xamarin.com/show_bug.cgi?id=3333) in Mono 2.10.x. Unit tests have been added with bug #3333 but it seems they do not cover this case.

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