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