C# TimeZoneInfo GetAdjustmentRules
Description
TimeZoneInfo GetAdjustmentRules
retrieves an array
of TimeZoneInfo.AdjustmentRule objects that apply to the current TimeZoneInfo
object.
Syntax
TimeZoneInfo.GetAdjustmentRules
has the following syntax.
public TimeZoneInfo.AdjustmentRule[] GetAdjustmentRules()
Returns
TimeZoneInfo.GetAdjustmentRules
method returns
Example
The following example gets adjustment rules.
using System.Globalization;
using System.Collections.ObjectModel;
using System;//from w ww .j a va 2s . co m
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();
}
}
}
The code above generates the following result.