Class TimeZoneData
Represents metadata for a timezone including daylight savings time history
Inheritance
Inherited Members
Namespace: Innovator.Client
Assembly: Innovator.Client.dll
Syntax
public class TimeZoneData : IEquatable<TimeZoneData>
Properties
| Improve this Doc View SourceId
Gets the time zone identifier.
Declaration
public string Id { get; }
Property Value
Type | Description |
---|---|
System.String | The time zone identifier. |
Local
Gets time zone information for the local time zone.
Declaration
public static TimeZoneData Local { get; }
Property Value
Type | Description |
---|---|
TimeZoneData | The time zone information for the local time zone. |
Utc
Gets time zone information for the UTC time zone.
Declaration
public static TimeZoneData Utc { get; }
Property Value
Type | Description |
---|---|
TimeZoneData | The time zone information for the UTC time zone. |
Methods
| Improve this Doc View SourceById(String)
Retrieves a TimeZoneData object from the registry based on its identifier.
Declaration
public static TimeZoneData ById(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The time zone identifier, which corresponds to the Id property. |
Returns
Type | Description |
---|---|
TimeZoneData | An object whose identifier is the value of the |
Exceptions
Type | Condition |
---|---|
System.OutOfMemoryException | The system does not have enough memory to hold information about the time zone. |
System.ArgumentNullException | The |
ConvertTime(DateTime, TimeZoneData, TimeZoneData)
Converts a time from one time zone to another.
Declaration
public static DateTime ConvertTime(DateTime value, TimeZoneData from, TimeZoneData to)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | value | The date and time to convert. |
TimeZoneData | from | The time zone of |
TimeZoneData | to | The time zone to convert |
Returns
Type | Description |
---|---|
System.DateTime | The date and time in the destination time zone that corresponds to the |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | The System.DateTime.Kind property of the
|
System.ArgumentNullException | The |
ConvertTime(DateTimeOffset, TimeZoneData)
Converts a time to the time in a particular time zone.
Declaration
public static DateTimeOffset ConvertTime(DateTimeOffset value, TimeZoneData to)
Parameters
Type | Name | Description |
---|---|---|
System.DateTimeOffset | value | The date and time to convert. |
TimeZoneData | to | The time zone to convert dateTime to. |
Returns
Type | Description |
---|---|
System.DateTimeOffset | The date and time in the destination time zone. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The value of the |
Equals(TimeZoneData)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(TimeZoneData other)
Parameters
Type | Name | Description |
---|---|---|
TimeZoneData | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
System.Boolean | true if the current object is equal to the |
Implements
Equals(Object)
Determines whether the specified System.Object, is equal to this instance.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The System.Object to compare with this instance. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Overrides
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Overrides
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.
Declaration
public TimeSpan GetUtcOffset(DateTime dateTime)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | dateTime | The date and time to determine the offset for. |
Returns
Type | Description |
---|---|
System.TimeSpan | An object that indicates the time difference between the two time zones. |
Operators
| Improve this Doc View SourceEquality(TimeZoneData, TimeZoneData)
Implements the operator ==.
Declaration
public static bool operator ==(TimeZoneData a, TimeZoneData b)
Parameters
Type | Name | Description |
---|---|---|
TimeZoneData | a | a. |
TimeZoneData | b | The b. |
Returns
Type | Description |
---|---|
System.Boolean | The result of the operator. |
Inequality(TimeZoneData, TimeZoneData)
Implements the operator !=.
Declaration
public static bool operator !=(TimeZoneData a, TimeZoneData b)
Parameters
Type | Name | Description |
---|---|---|
TimeZoneData | a | a. |
TimeZoneData | b | The b. |
Returns
Type | Description |
---|---|
System.Boolean | The result of the operator. |