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