Get TimeZoneInfo.AdjustmentRule objects that apply to the current TimeZoneInfo object in CSharp
Description
The following code shows how to get TimeZoneInfo.AdjustmentRule objects that apply to the current TimeZoneInfo object.
Example
//from w ww. j ava2 s. co m
using System.Globalization;
using System.Collections.ObjectModel;
using System;
public class MainClass{
public static void Main(String[] argv){
ReadOnlyCollection<TimeZoneInfo> timeZones = TimeZoneInfo.GetSystemTimeZones();
string[] monthNames = CultureInfo.CurrentCulture.DateTimeFormat.MonthNames;
foreach (TimeZoneInfo timeZone in timeZones)
{
TimeZoneInfo.AdjustmentRule[] adjustments = timeZone.GetAdjustmentRules();
}
}
}