mscorlib(4.0.0.0) API with additions
|
Represents any time zone in the world. More...
Classes | |
class | AdjustmentRule |
Provides information about a time zone adjustment, such as the transition to and from daylight saving time. More... | |
struct | TransitionTime |
Provides information about a specific time change, such as the change from daylight saving time to standard time or vice versa, in a particular time zone. More... | |
Public Member Functions | |
AdjustmentRule [] | GetAdjustmentRules () |
Retrieves an array of T:System.TimeZoneInfo.AdjustmentRule objects that apply to the current T:System.TimeZoneInfo object. More... | |
TimeSpan [] | GetAmbiguousTimeOffsets (DateTimeOffset dateTimeOffset) |
Returns information about the possible dates and times that an ambiguous date and time can be mapped to. More... | |
TimeSpan [] | GetAmbiguousTimeOffsets (DateTime dateTime) |
Returns information about the possible dates and times that an ambiguous date and time can be mapped to. More... | |
TimeSpan | GetUtcOffset (DateTimeOffset dateTimeOffset) |
Calculates the offset or difference between the time in this time zone and Coordinated Universal Time (UTC) for a particular date and time. More... | |
TimeSpan | GetUtcOffset (DateTime dateTime) |
Calculates the offset or difference between the time in this time zone and Coordinated Universal Time (UTC) for a particular date and time. More... | |
bool | IsAmbiguousTime (DateTimeOffset dateTimeOffset) |
Determines whether a particular date and time in a particular time zone is ambiguous and can be mapped to two or more Coordinated Universal Time (UTC) times. More... | |
bool | IsAmbiguousTime (DateTime dateTime) |
Determines whether a particular date and time in a particular time zone is ambiguous and can be mapped to two or more Coordinated Universal Time (UTC) times. More... | |
bool | IsDaylightSavingTime (DateTimeOffset dateTimeOffset) |
Indicates whether a specified date and time falls in the range of daylight saving time for the time zone of the current T:System.TimeZoneInfo object. More... | |
bool | IsDaylightSavingTime (DateTime dateTime) |
Indicates whether a specified date and time falls in the range of daylight saving time for the time zone of the current T:System.TimeZoneInfo object. More... | |
bool | IsInvalidTime (DateTime dateTime) |
Indicates whether a particular date and time is invalid. More... | |
bool | Equals (TimeZoneInfo other) |
Determines whether the current T:System.TimeZoneInfo object and another T:System.TimeZoneInfo object are equal. More... | |
override bool | Equals (object obj) |
Determines whether the current T:System.TimeZoneInfo object and another object are equal. More... | |
override int | GetHashCode () |
Serves as a hash function for hashing algorithms and data structures such as hash tables. More... | |
bool | HasSameRules (TimeZoneInfo other) |
Indicates whether the current object and another T:System.TimeZoneInfo object have the same adjustment rules. More... | |
string | ToSerializedString () |
Converts the current T:System.TimeZoneInfo object to a serialized string. More... | |
override string | ToString () |
Returns the current T:System.TimeZoneInfo object's display name. More... | |
![]() | |
bool | Equals (T other) |
Indicates whether the current object is equal to another object of the same type. More... | |
Static Public Member Functions | |
static void | ClearCachedData () |
Clears cached time zone data. More... | |
static DateTimeOffset | ConvertTimeBySystemTimeZoneId (DateTimeOffset dateTimeOffset, string destinationTimeZoneId) |
Converts a time to the time in another time zone based on the time zone's identifier. More... | |
static DateTime | ConvertTimeBySystemTimeZoneId (DateTime dateTime, string destinationTimeZoneId) |
Converts a time to the time in another time zone based on the time zone's identifier. More... | |
static DateTime | ConvertTimeBySystemTimeZoneId (DateTime dateTime, string sourceTimeZoneId, string destinationTimeZoneId) |
Converts a time from one time zone to another based on time zone identifiers. More... | |
static DateTimeOffset | ConvertTime (DateTimeOffset dateTimeOffset, TimeZoneInfo destinationTimeZone) |
Converts a time to the time in a particular time zone. More... | |
static DateTime | ConvertTime (DateTime dateTime, TimeZoneInfo destinationTimeZone) |
Converts a time to the time in a particular time zone. More... | |
static DateTime | ConvertTime (DateTime dateTime, TimeZoneInfo sourceTimeZone, TimeZoneInfo destinationTimeZone) |
Converts a time from one time zone to another. More... | |
static DateTime | ConvertTimeFromUtc (DateTime dateTime, TimeZoneInfo destinationTimeZone) |
Converts a Coordinated Universal Time (UTC) to the time in a specified time zone. More... | |
static DateTime | ConvertTimeToUtc (DateTime dateTime) |
Converts the specified date and time to Coordinated Universal Time (UTC). More... | |
static DateTime | ConvertTimeToUtc (DateTime dateTime, TimeZoneInfo sourceTimeZone) |
Converts the time in a specified time zone to Coordinated Universal Time (UTC). More... | |
static TimeZoneInfo | FromSerializedString (string source) |
Deserializes a string to re-create an original serialized T:System.TimeZoneInfo object. More... | |
static ReadOnlyCollection< TimeZoneInfo > | GetSystemTimeZones () |
Returns a sorted collection of all the time zones about which information is available on the local system. More... | |
static TimeZoneInfo | CreateCustomTimeZone (string id, TimeSpan baseUtcOffset, string displayName, string standardDisplayName) |
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. More... | |
static TimeZoneInfo | CreateCustomTimeZone (string id, TimeSpan baseUtcOffset, string displayName, string standardDisplayName, string daylightDisplayName, AdjustmentRule[] adjustmentRules) |
Creates a custom time zone with a specified identifier, an offset from Coordinated Universal Time (UTC), a display name, a standard time name, a daylight saving time name, and daylight saving time rules. More... | |
static TimeZoneInfo | CreateCustomTimeZone (string id, TimeSpan baseUtcOffset, string displayName, string standardDisplayName, string daylightDisplayName, AdjustmentRule[] adjustmentRules, bool disableDaylightSavingTime) |
Creates a custom time zone with a specified identifier, an offset from Coordinated Universal Time (UTC), a display name, a standard time name, a daylight saving time name, daylight saving time rules, and a value that indicates whether the returned object reflects daylight saving time information. More... | |
static TimeZoneInfo | FindSystemTimeZoneById (string id) |
Retrieves a T:System.TimeZoneInfo object from the registry based on its identifier. More... | |
Properties | |
string | Id [get] |
Gets the time zone identifier. More... | |
string | DisplayName [get] |
Gets the general display name that represents the time zone. More... | |
string | StandardName [get] |
Gets the display name for the time zone's standard time. More... | |
string | DaylightName [get] |
Gets the display name for the current time zone's daylight saving time. More... | |
TimeSpan | BaseUtcOffset [get] |
Gets the time difference between the current time zone's standard time and Coordinated Universal Time (UTC). More... | |
bool | SupportsDaylightSavingTime [get] |
Gets a value indicating whether the time zone has any daylight saving time rules. More... | |
static TimeZoneInfo | Local [get] |
Gets a T:System.TimeZoneInfo object that represents the local time zone. More... | |
static TimeZoneInfo | Utc [get] |
Gets a T:System.TimeZoneInfo object that represents the Coordinated Universal Time (UTC) zone. More... | |
Represents any time zone in the world.
Definition at line 20 of file TimeZoneInfo.cs.
|
static |
Clears cached time zone data.
Definition at line 1544 of file TimeZoneInfo.cs.
|
static |
Converts a time to the time in a particular time zone.
dateTimeOffset | The date and time to convert. |
destinationTimeZone | The time zone to convert dateTime to. |
T:System.ArgumentNullException | The value of the destinationTimeZone parameter is null . |
Definition at line 1612 of file TimeZoneInfo.cs.
|
static |
Converts a time to the time in a particular time zone.
dateTime | The date and time to convert. |
destinationTimeZone | The time zone to convert dateTime to. |
T:System.ArgumentException | The value of the dateTime parameter represents an invalid time. |
T:System.ArgumentNullException | The value of the destinationTimeZone parameter is null . |
Definition at line 1639 of file TimeZoneInfo.cs.
|
static |
Converts a time from one time zone to another.
dateTime | The date and time to convert. |
sourceTimeZone | The time zone of dateTime . |
destinationTimeZone | The time zone to convert dateTime to. |
T:System.ArgumentException | The P:System.DateTime.Kind property of the dateTime parameter is F:System.DateTimeKind.Local, but the sourceTimeZone parameter does not equal F:System.DateTimeKind.Local. For more information, see the Remarks section. -or-The P:System.DateTime.Kind property of the dateTime parameter is F:System.DateTimeKind.Utc, but the sourceTimeZone parameter does not equal P:System.TimeZoneInfo.Utc.-or-The dateTime parameter is an invalid time (that is, it represents a time that does not exist because of a time zone's adjustment rules). |
T:System.ArgumentNullException | The sourceTimeZone parameter is null .-or-The destinationTimeZone parameter is null . |
Definition at line 1665 of file TimeZoneInfo.cs.
|
static |
Converts a time to the time in another time zone based on the time zone's identifier.
dateTimeOffset | The date and time to convert. |
destinationTimeZoneId | The identifier of the destination time zone. |
T:System.ArgumentNullException | destinationTimeZoneId is null . |
T:System.InvalidTimeZoneException | The time zone identifier was found but the registry data is corrupted. |
T:System.Security.SecurityException | The process does not have the permissions required to read from the registry key that contains the time zone information. |
T:System.TimeZoneNotFoundException | The destinationTimeZoneId identifier was not found on the local system. |
Definition at line 1558 of file TimeZoneInfo.cs.
|
static |
Converts a time to the time in another time zone based on the time zone's identifier.
dateTime | The date and time to convert. |
destinationTimeZoneId | The identifier of the destination time zone. |
T:System.ArgumentNullException | destinationTimeZoneId is null . |
T:System.InvalidTimeZoneException | The time zone identifier was found, but the registry data is corrupted. |
T:System.Security.SecurityException | The process does not have the permissions required to read from the registry key that contains the time zone information. |
T:System.TimeZoneNotFoundException | The destinationTimeZoneId identifier was not found on the local system. |
Definition at line 1572 of file TimeZoneInfo.cs.
|
static |
Converts a time from one time zone to another based on time zone identifiers.
dateTime | The date and time to convert. |
sourceTimeZoneId | The identifier of the source time zone. |
destinationTimeZoneId | The identifier of the destination time zone. |
T:System.ArgumentException | The P:System.DateTime.Kind property of the dateTime parameter does not correspond to the source time zone.-or- dateTime is an invalid time in the source time zone. |
T:System.ArgumentNullException | sourceTimeZoneId is null .-or- destinationTimeZoneId is null . |
T:System.InvalidTimeZoneException | The time zone identifiers were found, but the registry data is corrupted. |
T:System.Security.SecurityException | The process does not have the permissions required to read from the registry key that contains the time zone information. |
T:System.TimeZoneNotFoundException | The sourceTimeZoneId identifier was not found on the local system.-or-The destinationTimeZoneId identifier was not found on the local system. |
T:System.Security.SecurityException | The user does not have the permissions required to read from the registry keys that hold time zone data. |
Definition at line 1591 of file TimeZoneInfo.cs.
|
static |
Converts a Coordinated Universal Time (UTC) to the time in a specified time zone.
dateTime | The Coordinated Universal Time (UTC). |
destinationTimeZone | The time zone to convert dateTime to. |
T:System.ArgumentException | The P:System.DateTime.Kind property of dateTime is F:System.DateTimeKind.Local. |
T:System.ArgumentNullException | destinationTimeZone is null . |
Definition at line 1729 of file TimeZoneInfo.cs.
Converts the specified date and time to Coordinated Universal Time (UTC).
dateTime | The date and time to convert. |
T:System.ArgumentException | TimeZoneInfo.Local.IsInvalidDateTime( dateTime ) returns true . |
Definition at line 1742 of file TimeZoneInfo.cs.
|
static |
Converts the time in a specified time zone to Coordinated Universal Time (UTC).
dateTime | The date and time to convert. |
sourceTimeZone | The time zone of dateTime . |
T:System.ArgumentException | dateTime .Kind is F:System.DateTimeKind.Utc and sourceTimeZone does not equal P:System.TimeZoneInfo.Utc.-or- dateTime .Kind is F:System.DateTimeKind.Local and sourceTimeZone does not equal P:System.TimeZoneInfo.Local.-or- sourceTimeZone .IsInvalidDateTime( dateTime ) returns true . |
T:System.ArgumentNullException | sourceTimeZone is null . |
Definition at line 1777 of file TimeZoneInfo.cs.
|
static |
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.
id | The time zone's identifier. |
baseUtcOffset | An object that represents the time difference between this time zone and Coordinated Universal Time (UTC). |
displayName | The display name of the new time zone. |
standardDisplayName | The name of the new time zone's standard time. |
T:System.ArgumentNullException | The id parameter is null . |
T:System.ArgumentException | The id parameter is an empty string ("").-or-The baseUtcOffset parameter does not represent a whole number of minutes. |
T:System.ArgumentOutOfRangeException | The baseUtcOffset parameter is greater than 14 hours or less than -14 hours. |
Definition at line 1980 of file TimeZoneInfo.cs.
|
static |
Creates a custom time zone with a specified identifier, an offset from Coordinated Universal Time (UTC), a display name, a standard time name, a daylight saving time name, and daylight saving time rules.
id | The time zone's identifier. |
baseUtcOffset | An object that represents the time difference between this time zone and Coordinated Universal Time (UTC). |
displayName | The display name of the new time zone. |
standardDisplayName | The new time zone's standard time name. |
daylightDisplayName | The daylight saving time name of the new time zone. |
adjustmentRules | An array that augments the base UTC offset for a particular period. |
T:System.ArgumentNullException | The id parameter is null . |
T:System.ArgumentException | The id parameter is an empty string ("").-or-The baseUtcOffset parameter does not represent a whole number of minutes. |
T:System.ArgumentOutOfRangeException | The baseUtcOffset parameter is greater than 14 hours or less than -14 hours. |
T:System.InvalidTimeZoneException | The adjustment rules specified in the adjustmentRules parameter overlap.-or-The adjustment rules specified in the adjustmentRules parameter are not in chronological order.-or-One or more elements in adjustmentRules are null .-or-A date can have multiple adjustment rules applied to it.-or-The sum of the baseUtcOffset parameter and the P:System.TimeZoneInfo.AdjustmentRule.DaylightDelta value of one or more objects in the adjustmentRules array is greater than 14 hours or less than -14 hours. |
Definition at line 1997 of file TimeZoneInfo.cs.
|
static |
Creates a custom time zone with a specified identifier, an offset from Coordinated Universal Time (UTC), a display name, a standard time name, a daylight saving time name, daylight saving time rules, and a value that indicates whether the returned object reflects daylight saving time information.
id | The time zone's identifier. |
baseUtcOffset | A T:System.TimeSpan object that represents the time difference between this time zone and Coordinated Universal Time (UTC). |
displayName | The display name of the new time zone. |
standardDisplayName | The standard time name of the new time zone. |
daylightDisplayName | The daylight saving time name of the new time zone. |
adjustmentRules | An array of T:System.TimeZoneInfo.AdjustmentRule objects that augment the base UTC offset for a particular period. |
disableDaylightSavingTime | true to discard any daylight saving time-related information present in adjustmentRules with the new object; otherwise, false . |
true
, the returned object has no daylight saving time data.T:System.ArgumentNullException | The id parameter is null . |
T:System.ArgumentException | The id parameter is an empty string ("").-or-The baseUtcOffset parameter does not represent a whole number of minutes. |
T:System.ArgumentOutOfRangeException | The baseUtcOffset parameter is greater than 14 hours or less than -14 hours. |
T:System.InvalidTimeZoneException | The adjustment rules specified in the adjustmentRules parameter overlap.-or-The adjustment rules specified in the adjustmentRules parameter are not in chronological order.-or-One or more elements in adjustmentRules are null .-or-A date can have multiple adjustment rules applied to it.-or-The sum of the baseUtcOffset parameter and the P:System.TimeZoneInfo.AdjustmentRule.DaylightDelta value of one or more objects in the adjustmentRules array is greater than 14 hours or less than -14 hours. |
Definition at line 2016 of file TimeZoneInfo.cs.
bool System.TimeZoneInfo.Equals | ( | TimeZoneInfo | other | ) |
Determines whether the current T:System.TimeZoneInfo object and another T:System.TimeZoneInfo object are equal.
other | A second object to compare with the current object. |
true
if the two T:System.TimeZoneInfo objects are equal; otherwise, false
.Definition at line 1788 of file TimeZoneInfo.cs.
override bool System.TimeZoneInfo.Equals | ( | object | obj | ) |
Determines whether the current T:System.TimeZoneInfo object and another object are equal.
obj | A second object to compare with the current object. |
true
if obj is a T:System.TimeZoneInfo object that is equal to the current instance; otherwise, false
.Definition at line 1801 of file TimeZoneInfo.cs.
|
static |
Retrieves a T:System.TimeZoneInfo object from the registry based on its identifier.
id | The time zone identifier, which corresponds to the P:System.TimeZoneInfo.Id property. |
T:System.OutOfMemoryException | The system does not have enough memory to hold information about the time zone. |
T:System.ArgumentNullException | The id parameter is null . |
T:System.TimeZoneNotFoundException | The time zone identifier specified by id was not found. This means that a registry key whose name matches id does not exist, or that the key exists but does not contain any time zone data. |
T:System.Security.SecurityException | The process does not have the permissions required to read from the registry key that contains the time zone information. |
T:System.InvalidTimeZoneException | The time zone identifier was found, but the registry data is corrupted. |
Definition at line 2515 of file TimeZoneInfo.cs.
|
static |
Deserializes a string to re-create an original serialized T:System.TimeZoneInfo object.
source | The string representation of the serialized T:System.TimeZoneInfo object. |
T:System.ArgumentException | The source parameter is F:System.String.Empty. |
T:System.ArgumentNullException | The source parameter is a null string. |
T:System.Runtime.Serialization.SerializationException | The source parameter cannot be deserialized back into a T:System.TimeZoneInfo object. |
Definition at line 1817 of file TimeZoneInfo.cs.
AdjustmentRule [] System.TimeZoneInfo.GetAdjustmentRules | ( | ) |
Retrieves an array of T:System.TimeZoneInfo.AdjustmentRule objects that apply to the current T:System.TimeZoneInfo object.
T:System.OutOfMemoryException | The system does not have enough memory to make an in-memory copy of the adjustment rules. |
Definition at line 1253 of file TimeZoneInfo.cs.
TimeSpan [] System.TimeZoneInfo.GetAmbiguousTimeOffsets | ( | DateTimeOffset | dateTimeOffset | ) |
Returns information about the possible dates and times that an ambiguous date and time can be mapped to.
dateTimeOffset | A date and time. |
T:System.ArgumentException | dateTimeOffset is not an ambiguous time. |
Definition at line 1268 of file TimeZoneInfo.cs.
Returns information about the possible dates and times that an ambiguous date and time can be mapped to.
dateTime | A date and time. |
T:System.ArgumentException | dateTime is not an ambiguous time. |
Definition at line 1307 of file TimeZoneInfo.cs.
override int System.TimeZoneInfo.GetHashCode | ( | ) |
Serves as a hash function for hashing algorithms and data structures such as hash tables.
Definition at line 1833 of file TimeZoneInfo.cs.
|
static |
Returns a sorted collection of all the time zones about which information is available on the local system.
T:System.OutOfMemoryException | There is insufficient memory to store all time zone information. |
T:System.Security.SecurityException | The user does not have permission to read from the registry keys that contain time zone information. |
Definition at line 1844 of file TimeZoneInfo.cs.
TimeSpan System.TimeZoneInfo.GetUtcOffset | ( | DateTimeOffset | dateTimeOffset | ) |
Calculates the offset or difference between the time in this time zone and Coordinated Universal Time (UTC) for a particular date and time.
dateTimeOffset | The date and time to determine the offset for. |
Definition at line 1358 of file TimeZoneInfo.cs.
Calculates the offset or difference between the time in this time zone and Coordinated Universal Time (UTC) for a particular date and time.
dateTime | The date and time to determine the offset for. |
Definition at line 1367 of file TimeZoneInfo.cs.
bool System.TimeZoneInfo.HasSameRules | ( | TimeZoneInfo | other | ) |
Indicates whether the current object and another T:System.TimeZoneInfo object have the same adjustment rules.
other | A second object to compare with the current T:System.TimeZoneInfo object. |
true
if the two time zones have identical adjustment rules and an identical base offset; otherwise, false
.T:System.ArgumentNullException | The other parameter is null . |
Definition at line 1879 of file TimeZoneInfo.cs.
bool System.TimeZoneInfo.IsAmbiguousTime | ( | DateTimeOffset | dateTimeOffset | ) |
Determines whether a particular date and time in a particular time zone is ambiguous and can be mapped to two or more Coordinated Universal Time (UTC) times.
dateTimeOffset | A date and time. |
true
if the dateTimeOffset parameter is ambiguous in the current time zone; otherwise, false
.Definition at line 1409 of file TimeZoneInfo.cs.
bool System.TimeZoneInfo.IsAmbiguousTime | ( | DateTime | dateTime | ) |
Determines whether a particular date and time in a particular time zone is ambiguous and can be mapped to two or more Coordinated Universal Time (UTC) times.
dateTime | A date and time value. |
true
if the dateTime parameter is ambiguous; otherwise, false
.T:System.ArgumentException | The P:System.DateTime.Kind property of the dateTime value is F:System.DateTimeKind.Local and dateTime is an invalid time. |
Definition at line 1424 of file TimeZoneInfo.cs.
bool System.TimeZoneInfo.IsDaylightSavingTime | ( | DateTimeOffset | dateTimeOffset | ) |
Indicates whether a specified date and time falls in the range of daylight saving time for the time zone of the current T:System.TimeZoneInfo object.
dateTimeOffset | A date and time value. |
true
if the dateTimeOffset parameter is a daylight saving time; otherwise, false
.Definition at line 1464 of file TimeZoneInfo.cs.
bool System.TimeZoneInfo.IsDaylightSavingTime | ( | DateTime | dateTime | ) |
Indicates whether a specified date and time falls in the range of daylight saving time for the time zone of the current T:System.TimeZoneInfo object.
dateTime | A date and time value. |
true
if the dateTime parameter is a daylight saving time; otherwise, false
.T:System.ArgumentException | The P:System.DateTime.Kind property of the dateTime value is F:System.DateTimeKind.Local and dateTime is an invalid time. |
Definition at line 1476 of file TimeZoneInfo.cs.
bool System.TimeZoneInfo.IsInvalidTime | ( | DateTime | dateTime | ) |
Indicates whether a particular date and time is invalid.
dateTime | A date and time value. |
true
if dateTime is invalid; otherwise, false
.Definition at line 1524 of file TimeZoneInfo.cs.
string System.TimeZoneInfo.ToSerializedString | ( | ) |
Converts the current T:System.TimeZoneInfo object to a serialized string.
Definition at line 1915 of file TimeZoneInfo.cs.
override string System.TimeZoneInfo.ToString | ( | ) |
Returns the current T:System.TimeZoneInfo object's display name.
Definition at line 1923 of file TimeZoneInfo.cs.
|
get |
Gets the time difference between the current time zone's standard time and Coordinated Universal Time (UTC).
Definition at line 1205 of file TimeZoneInfo.cs.
|
get |
Gets the display name for the current time zone's daylight saving time.
Definition at line 1189 of file TimeZoneInfo.cs.
|
get |
Gets the general display name that represents the time zone.
Definition at line 1157 of file TimeZoneInfo.cs.
|
get |
Gets the time zone identifier.
Definition at line 1145 of file TimeZoneInfo.cs.
|
staticget |
Gets a T:System.TimeZoneInfo object that represents the local time zone.
Definition at line 1230 of file TimeZoneInfo.cs.
|
get |
Gets the display name for the time zone's standard time.
Definition at line 1173 of file TimeZoneInfo.cs.
|
get |
Gets a value indicating whether the time zone has any daylight saving time rules.
true
if the time zone supports daylight saving time; otherwise, false
.Definition at line 1218 of file TimeZoneInfo.cs.
|
staticget |
Gets a T:System.TimeZoneInfo object that represents the Coordinated Universal Time (UTC) zone.
Definition at line 1242 of file TimeZoneInfo.cs.