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.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version