Get a TimeZoneInfo from the registry based on its identifier in CSharp

Description

The following code shows how to get a TimeZoneInfo from the registry based on its identifier.

Example


/*  w  w w  .j a  va2s.  c  om*/
using System;

public class Example
{
   public static void Main()
   {
      DateTime thisTime = DateTime.Now;

      // Get Tokyo Standard Time zone
      TimeZoneInfo tst = TimeZoneInfo.FindSystemTimeZoneById("Tokyo Standard Time");
      DateTime tstTime = TimeZoneInfo.ConvertTime(thisTime, TimeZoneInfo.Local, tst);      


   }
}




















Home »
  C# Tutorial »
    Data Types »




C# Data Types
Bool
Byte
Char
Decimal
Double
Float
Integer
Long
Short
String
C# Array
Array Example
Byte Array
C# Standard Data Type Format
BigInteger
Complex
Currency
DateTime
DateTimeOffset
DateTime Format Parse Convert
TimeSpan
TimeZone
Enum
Null
tuple
var