Class Int16Extensions
Time-related extension methods for
Inheritance
Namespace: X10D.Time
Assembly: X10D.dll
Syntax
public static class Int16Extensions : object
Methods
| Improve this Doc View SourceDays(Int16)
Returns a
Declaration
public static TimeSpan Days(this short value)
Parameters
Type | Name | Description |
---|---|---|
System.Int16 | value | The duration, in days. |
Returns
Type | Description |
---|---|
TimeSpan | A |
FromUnixTimeMilliseconds(Int16)
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 short value)
Parameters
Type | Name | Description |
---|---|---|
System.Int16 | 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(Int16)
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 short value)
Parameters
Type | Name | Description |
---|---|---|
System.Int16 | 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(Int16)
Returns a
Declaration
public static TimeSpan Hours(this short value)
Parameters
Type | Name | Description |
---|---|---|
System.Int16 | value | The duration, in hours. |
Returns
Type | Description |
---|---|
TimeSpan | A |
IsLeapYear(Int16)
Returns a value indicating whether the current integer, representing a year, is a leap year.
Declaration
public static bool IsLeapYear(this short value)
Parameters
Type | Name | Description |
---|---|---|
System.Int16 | value | The value whose leap year status to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if |
Milliseconds(Int16)
Returns a
Declaration
public static TimeSpan Milliseconds(this short value)
Parameters
Type | Name | Description |
---|---|---|
System.Int16 | value | The duration, in milliseconds. |
Returns
Type | Description |
---|---|
TimeSpan | A |
Minutes(Int16)
Returns a
Declaration
public static TimeSpan Minutes(this short value)
Parameters
Type | Name | Description |
---|---|---|
System.Int16 | value | The duration, in minutes. |
Returns
Type | Description |
---|---|
TimeSpan | A |
Seconds(Int16)
Returns a
Declaration
public static TimeSpan Seconds(this short value)
Parameters
Type | Name | Description |
---|---|---|
System.Int16 | value | The duration, in seconds. |
Returns
Type | Description |
---|---|
TimeSpan | A |
Ticks(Int16)
Returns a
Declaration
public static TimeSpan Ticks(this short value)
Parameters
Type | Name | Description |
---|---|---|
System.Int16 | value | The duration, in ticks. |
Returns
Type | Description |
---|---|
TimeSpan | A |
Weeks(Int16)
Returns a
Declaration
public static TimeSpan Weeks(this short value)
Parameters
Type | Name | Description |
---|---|---|
System.Int16 | value | The duration, in weeks. |
Returns
Type | Description |
---|---|
TimeSpan | A |