← Interactive API Explorer
Namespace: System

TimeZoneInfo

Represents any time zone in the world.

Properties (2)

TimeZoneInfo Local
Gets a TimeZoneInfo object that represents the local time zone.
Value: An object that represents the local time zone.
TimeSpan BaseUtcOffset
Gets the time difference between the current time zone's standard time and Coordinated Universal Time (UTC).
Value: An object that indicates the time difference between the current time zone's standard time and Coordinated Universal Time (UTC).

Methods (3)

TimeZoneInfo CreateCustomTimeZone(String,TimeSpan,String,String)
Creates a custom time zone with a specified identifier, an offset from Coordinated Universal Time (UTC), a display name, and a standard time display name.
ParameterDescription
idThe time zone's identifier.
baseUtcOffsetAn object that represents the time difference between this time zone and Coordinated Universal Time (UTC).
displayNameThe display name of the new time zone.
standardDisplayNameThe name of the new time zone's standard time.
Returns: The new time zone.
TimeSpan GetUtcOffset(DateTime)
Calculates the offset or difference between the time in this time zone and Coordinated Universal Time (UTC) for a particular date and time.
ParameterDescription
dateTimeThe date and time to determine the offset for.
Returns: An object that indicates the time difference between the two time zones.
TimeSpan GetUtcOffset(DateTimeOffset)
Calculates the offset or difference between the time in this time zone and Coordinated Universal Time (UTC) for a particular date and time.
ParameterDescription
dateTimeOffsetThe date and time to determine the offset for.
Returns: An object that indicates the time difference between Coordinated Universal Time (UTC) and the current time zone.