Class UserTimeZone
Represents an user time zone used for the date-time auto-calculation.
Inheritance
Implements
Namespace: Mediachase.BusinessFoundation.Data
Assembly: Mediachase.BusinessFoundation.Data.dll
Version: 14.26.0Syntax
public sealed class UserTimeZone : TimeZone, IComparable<TimeZone>, IComparable, IDeserializationCallback
Constructors
UserTimeZone(String, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32)
Initializes a new instance of the UserTimeZone class.
Declaration
public UserTimeZone(string name, int bias, int daylightBias, int daylightMonth, int daylightDayOfWeek, int daylightDay, int daylightHour, int standardBias, int standardMonth, int standardDayOfWeek, int standardDay, int standardHour)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name. |
System.Int32 | bias | The bias. |
System.Int32 | daylightBias | The daylight bias. |
System.Int32 | daylightMonth | The daylight month. |
System.Int32 | daylightDayOfWeek | The daylight day of week. |
System.Int32 | daylightDay | The daylight day. |
System.Int32 | daylightHour | The daylight hour. |
System.Int32 | standardBias | The standard bias. |
System.Int32 | standardMonth | The standard month. |
System.Int32 | standardDayOfWeek | The standard day of week. |
System.Int32 | standardDay | The standard day. |
System.Int32 | standardHour | The standard hour. |
Properties
DaylightName
Gets the daylight saving time zone name.
Declaration
public override string DaylightName { get; }
Property Value
Type | Description |
---|---|
System.String |
Description
Gets or sets the description.
Declaration
public string Description { get; set; }
Property Value
Type | Description |
---|---|
System.String | The description. |
DisplayName
Gets or sets the display name.
Declaration
public string DisplayName { get; set; }
Property Value
Type | Description |
---|---|
System.String | The display name. |
Name
Gets the standard time zone name.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String |
StandardName
Gets the standard time zone name.
Declaration
public override string StandardName { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
CompareTo(Object)
Compares the current instance with another object of the same type.
Declaration
public int CompareTo(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | An object to compare with this instance. |
Returns
Type | Description |
---|---|
System.Int32 | A 32-bit integer that indicates the relative order of the entities being compared. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException |
|
Equals(Object)
Determines whether the specified System.Object is equal to the current System.Object.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The System.Object to compare with the current System.Object. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified System.Object is equal to the current System.Object; otherwise, false. |
Exceptions
Type | Condition |
---|---|
System.NullReferenceException | The |
GetDaylightChanges(Int32)
Returns the daylight saving time period for a particular year.
Declaration
public override DaylightTime GetDaylightChanges(int year)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | year | The year to which the daylight saving time period applies. |
Returns
Type | Description |
---|---|
System.Globalization.DaylightTime | A System.Globalization.DaylightTime instance containing the start and end date for daylight saving time in year. |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException |
|
GetHashCode()
Serves as a hash function for a particular type.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code for the current System.Object. |
GetUtcOffset(DateTime)
Returns the coordinated universal time (UTC) offset for the specified local time.
Declaration
public override TimeSpan GetUtcOffset(DateTime time)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | time | The local date and time. |
Returns
Type | Description |
---|---|
System.TimeSpan | The UTC offset from time, measured in ticks. |
ToLocalTime(DateTime)
Returns the local time that corresponds to a specified coordinated universal time (UTC).
Declaration
public override DateTime ToLocalTime(DateTime time)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | time | A UTC time. |
Returns
Type | Description |
---|---|
System.DateTime | A System.DateTime instance whose value is the local time that corresponds to time. |
ToString()
Returns a System.String representing the time zone.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |
ToUniversalTime(DateTime)
Returns the coordinated universal time (UTC) that corresponds to a specified local time.
Declaration
public override DateTime ToUniversalTime(DateTime time)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | time | The local date and time. |
Returns
Type | Description |
---|---|
System.DateTime | A System.DateTime instance whose value is the UTC time that corresponds to time. |
UpdateNames(String, String)
Updates the display names.
Declaration
public void UpdateNames(string standartName, string daylightName)
Parameters
Type | Name | Description |
---|---|---|
System.String | standartName | Name of the standart. |
System.String | daylightName | Name of the daylight. |
Operators
Equality(UserTimeZone, UserTimeZone)
Implements the operator ==.
Declaration
public static bool operator ==(UserTimeZone t1, UserTimeZone t2)
Parameters
Type | Name | Description |
---|---|---|
UserTimeZone | t1 | The t1. |
UserTimeZone | t2 | The t2. |
Returns
Type | Description |
---|---|
System.Boolean | The result of the operator. |
GreaterThan(UserTimeZone, UserTimeZone)
Implements the operator >.
Declaration
public static bool operator>(UserTimeZone t1, UserTimeZone t2)
Parameters
Type | Name | Description |
---|---|---|
UserTimeZone | t1 | The t1. |
UserTimeZone | t2 | The t2. |
Returns
Type | Description |
---|---|
System.Boolean | The result of the operator. |
Inequality(UserTimeZone, UserTimeZone)
Implements the operator !=.
Declaration
public static bool operator !=(UserTimeZone t1, UserTimeZone t2)
Parameters
Type | Name | Description |
---|---|---|
UserTimeZone | t1 | The t1. |
UserTimeZone | t2 | The t2. |
Returns
Type | Description |
---|---|
System.Boolean | The result of the operator. |
LessThan(UserTimeZone, UserTimeZone)
Implements the operator <.
Declaration
public static bool operator <(UserTimeZone t1, UserTimeZone t2)
Parameters
Type | Name | Description |
---|---|---|
UserTimeZone | t1 | The t1. |
UserTimeZone | t2 | The t2. |
Returns
Type | Description |
---|---|
System.Boolean | The result of the operator. |