C# TimeZoneInfo BaseUtcOffset
Description
TimeZoneInfo BaseUtcOffset
gets the time difference
between the current time zone's standard time and Coordinated Universal
Time (UTC).
Syntax
TimeZoneInfo.BaseUtcOffset
has the following syntax.
public TimeSpan BaseUtcOffset { get; }
Example
The following example uses the BaseUtcOffset property to display the difference between the local time and Coordinated Universal Time (UTC).
/*from ww w. ja v a2s. c om*/
using System;
public class MainClass{
public static void Main(String[] argv){
TimeZoneInfo localZone = TimeZoneInfo.Local;
Console.WriteLine(localZone.BaseUtcOffset.Hours);
}
}
The code above generates the following result.