mscorlib(4.0.0.0) API with additions
System.TimeZone Class Referenceabstract

Represents a time zone. More...

Inherited by System.CurrentSystemTimeZone.

Public Member Functions

abstract TimeSpan GetUtcOffset (DateTime time)
 Returns the Coordinated Universal Time (UTC) offset for the specified local time. More...
 
virtual DateTime ToUniversalTime (DateTime time)
 Returns the Coordinated Universal Time (UTC) that corresponds to a specified time. More...
 
virtual DateTime ToLocalTime (DateTime time)
 Returns the local time that corresponds to a specified date and time value. More...
 
abstract DaylightTime GetDaylightChanges (int year)
 Returns the daylight saving time period for a particular year. More...
 
virtual bool IsDaylightSavingTime (DateTime time)
 Returns a value indicating whether the specified date and time is within a daylight saving time period. More...
 

Static Public Member Functions

static bool IsDaylightSavingTime (DateTime time, DaylightTime daylightTimes)
 Returns a value indicating whether the specified date and time is within the specified daylight saving time period. More...
 

Properties

static TimeZone CurrentTimeZone [get]
 Gets the time zone of the current computer. More...
 
abstract string StandardName [get]
 Gets the standard time zone name. More...
 
abstract string DaylightName [get]
 Gets the daylight saving time zone name. More...
 

Detailed Description

Represents a time zone.

Definition at line 10 of file TimeZone.cs.

Member Function Documentation

◆ GetDaylightChanges()

abstract DaylightTime System.TimeZone.GetDaylightChanges ( int  year)
pure virtual

Returns the daylight saving time period for a particular year.

Parameters
yearThe year that the daylight saving time period applies to.
Returns
A T:System.Globalization.DaylightTime object that contains the start and end date for daylight saving time in year .
Exceptions
T:System.ArgumentOutOfRangeExceptionyear is less than 1 or greater than 9999.

◆ GetUtcOffset()

abstract TimeSpan System.TimeZone.GetUtcOffset ( DateTime  time)
pure virtual

Returns the Coordinated Universal Time (UTC) offset for the specified local time.

Parameters
timeA date and time value.
Returns
The Coordinated Universal Time (UTC) offset from time .

◆ IsDaylightSavingTime() [1/2]

virtual bool System.TimeZone.IsDaylightSavingTime ( DateTime  time)
virtual

Returns a value indicating whether the specified date and time is within a daylight saving time period.

Parameters
timeA date and time.
Returns
true if time is in a daylight saving time period; otherwise, false.

Definition at line 128 of file TimeZone.cs.

◆ IsDaylightSavingTime() [2/2]

static bool System.TimeZone.IsDaylightSavingTime ( DateTime  time,
DaylightTime  daylightTimes 
)
static

Returns a value indicating whether the specified date and time is within the specified daylight saving time period.

Parameters
timeA date and time.
daylightTimesA daylight saving time period.
Returns
true if time is in daylightTimes ; otherwise, false.
Exceptions
T:System.ArgumentNullExceptiondaylightTimes is null.

Definition at line 140 of file TimeZone.cs.

◆ ToLocalTime()

virtual DateTime System.TimeZone.ToLocalTime ( DateTime  time)
virtual

Returns the local time that corresponds to a specified date and time value.

Parameters
timeA Coordinated Universal Time (UTC) time.
Returns
A T:System.DateTime object whose value is the local time that corresponds to time .

Definition at line 106 of file TimeZone.cs.

◆ ToUniversalTime()

virtual DateTime System.TimeZone.ToUniversalTime ( DateTime  time)
virtual

Returns the Coordinated Universal Time (UTC) that corresponds to a specified time.

Parameters
timeA date and time.
Returns
A T:System.DateTime object whose value is the Coordinated Universal Time (UTC) that corresponds to time .

Definition at line 85 of file TimeZone.cs.

Property Documentation

◆ CurrentTimeZone

TimeZone System.TimeZone.CurrentTimeZone
staticget

Gets the time zone of the current computer.

Returns
A T:System.TimeZone object that represents the current local time zone.

Definition at line 32 of file TimeZone.cs.

◆ DaylightName

abstract string System.TimeZone.DaylightName
get

Gets the daylight saving time zone name.

Returns
The daylight saving time zone name.

Definition at line 62 of file TimeZone.cs.

◆ StandardName

abstract string System.TimeZone.StandardName
get

Gets the standard time zone name.

Returns
The standard time zone name.
Exceptions
T:System.ArgumentNullExceptionAn attempt was made to set this property to null.

Definition at line 55 of file TimeZone.cs.


The documentation for this class was generated from the following file: