Class UInt16Extensions
Time-related extension methods for
Inheritance
Namespace: X10D.Time
Assembly: X10D.dll
Syntax
public static class UInt16Extensions : object
Methods
| Improve this Doc View SourceDays(UInt16)
Returns a
Declaration
public static TimeSpan Days(this ushort value)
Parameters
Type | Name | Description |
---|---|---|
System.UInt16 | value | The duration, in days. |
Returns
Type | Description |
---|---|
TimeSpan | A |
FromUnixTimeMilliseconds(UInt16)
Converts a Unix time expressed as the number of milliseconds that have elapsed since 1970-01-01T00:00:00Z to a
Declaration
public static DateTimeOffset FromUnixTimeMilliseconds(this ushort value)
Parameters
Type | Name | Description |
---|---|---|
System.UInt16 | value | A Unix time, expressed as the number of milliseconds that have elapsed since 1970-01-01T00:00:00Z (January 1, 1970, at 12:00 AM UTC). For Unix times before this date, its value is negative. |
Returns
Type | Description |
---|---|
DateTimeOffset | A date and time value that represents the same moment in time as the Unix time. |
FromUnixTimeSeconds(UInt16)
Converts a Unix time expressed as the number of seconds that have elapsed since 1970-01-01T00:00:00Z to a
Declaration
public static DateTimeOffset FromUnixTimeSeconds(this ushort value)
Parameters
Type | Name | Description |
---|---|---|
System.UInt16 | value | A Unix time, expressed as the number of seconds that have elapsed since 1970-01-01T00:00:00Z (January 1, 1970, at 12:00 AM UTC). For Unix times before this date, its value is negative. |
Returns
Type | Description |
---|---|
DateTimeOffset | A date and time value that represents the same moment in time as the Unix time. |
Hours(UInt16)
Returns a
Declaration
public static TimeSpan Hours(this ushort value)
Parameters
Type | Name | Description |
---|---|---|
System.UInt16 | value | The duration, in hours. |
Returns
Type | Description |
---|---|
TimeSpan | A |
IsLeapYear(UInt16)
Returns a value indicating whether the current integer, representing a year, is a leap year.
Declaration
public static bool IsLeapYear(this ushort value)
Parameters
Type | Name | Description |
---|---|---|
System.UInt16 | value | The value whose leap year status to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if |
Milliseconds(UInt16)
Returns a
Declaration
public static TimeSpan Milliseconds(this ushort value)
Parameters
Type | Name | Description |
---|---|---|
System.UInt16 | value | The duration, in milliseconds. |
Returns
Type | Description |
---|---|
TimeSpan | A |
Minutes(UInt16)
Returns a
Declaration
public static TimeSpan Minutes(this ushort value)
Parameters
Type | Name | Description |
---|---|---|
System.UInt16 | value | The duration, in minutes. |
Returns
Type | Description |
---|---|
TimeSpan | A |
Seconds(UInt16)
Returns a
Declaration
public static TimeSpan Seconds(this ushort value)
Parameters
Type | Name | Description |
---|---|---|
System.UInt16 | value | The duration, in seconds. |
Returns
Type | Description |
---|---|
TimeSpan | A |
Ticks(UInt16)
Returns a
Declaration
public static TimeSpan Ticks(this ushort value)
Parameters
Type | Name | Description |
---|---|---|
System.UInt16 | value | The duration, in ticks. |
Returns
Type | Description |
---|---|
TimeSpan | A |
Weeks(UInt16)
Returns a
Declaration
public static TimeSpan Weeks(this ushort value)
Parameters
Type | Name | Description |
---|---|---|
System.UInt16 | value | The duration, in weeks. |
Returns
Type | Description |
---|---|
TimeSpan | A |