Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class System.​TimeZone
Assembly: System.Runtime
Inheritance: object → TimeZone
Represents a time zone.
Properties
public
string
DaylightName
Gets the daylight saving time zone name.
public
string
StandardName
Gets the standard time zone name.
Methods
public
DaylightTime
GetDaylightChanges​(int year)
year
The year that the daylight saving time period applies to.
Returns A <see cref="T:System.Globalization.DaylightTime" /> object that contains the start and end date for daylight saving time in <paramref name="year" /> .
Returns the daylight saving time period for a particular year.
public
TimeSpan
GetUtcOffset​(DateTime time)
time
A date and time value.
Returns The Coordinated Universal Time (UTC) offset from <paramref name="time" /> .
Returns the Coordinated Universal Time (UTC) offset for the specified local time.
public
bool
IsDaylightSavingTime​(DateTime time)
time
A date and time.
Returns <see langword="true" /> if <paramref name="time" /> is in a daylight saving time period; otherwise, <see langword="false" /> .
Returns a value indicating whether the specified date and time is within a daylight saving time period.
public
DateTime
ToLocalTime​(DateTime time)
time
A Coordinated Universal Time (UTC) time.
Returns A <see cref="T:System.DateTime" /> object whose value is the local time that corresponds to <paramref name="time" /> .
Returns the local time that corresponds to a specified date and time value.
public
DateTime
ToUniversalTime​(DateTime time)
time
A date and time.
Returns A <see cref="T:System.DateTime" /> object whose value is the Coordinated Universal Time (UTC) that corresponds to <paramref name="time" /> .
Returns the Coordinated Universal Time (UTC) that corresponds to a specified time.
public
bool
Equals​(object obj)
Inherited from object
obj
The object to compare with the current object.
Returns <see langword="true" /> if the specified object is equal to the current object; otherwise, <see langword="false" /> .
Determines whether the specified object is equal to the current object.
protected
void
Finalize​()
Inherited from object
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
public
int
GetHashCode​()
Inherited from object
Returns A hash code for the current object.
Serves as the default hash function.
public
Type
GetType​()
Inherited from object
Returns The exact runtime type of the current instance.
Gets the <see cref="T:System.Type" /> of the current instance.
protected
object
MemberwiseClone​()
Inherited from object
Returns A shallow copy of the current <see cref="T:System.Object" /> .
Creates a shallow copy of the current <see cref="T:System.Object" /> .
public
string
ToString​()
Inherited from object
Returns A string that represents the current object.
Returns a string that represents the current object.