/ fm / liveswitch / UnixTimestamp
Class: UnixTimestamp
fm.liveswitch.UnixTimestamp
Utility class to assist with Unix timestamp conversions.
Table of contents
Constructors
Methods
- getTypeString
- dateTimeToUnix
- dateTimeToUnixMillis
- getUtcNow
- getUtcNowMillis
- ticksToUnix
- ticksToUnixMillis
- unixMillisToDateTime
- unixMillisToTicks
- unixToDateTime
- unixToTicks
Constructors
constructor
+ new UnixTimestamp(): UnixTimestamp
Returns: UnixTimestamp
Defined in: Generated/TypeScript/fm.liveswitch/UnixTimestamp.ts:13
Methods
getTypeString
▸ getTypeString(): string
Returns: string
Defined in: Generated/TypeScript/fm.liveswitch/UnixTimestamp.ts:9
dateTimeToUnix
▸ Static
dateTimeToUnix(dateTime
: DateTime): number
Converts a date to a Unix timestamp.
Parameters:
Name | Type | Description |
---|---|---|
dateTime |
DateTime | The date to convert. |
Returns: number
The equivalent Unix timestamp.
Defined in: Generated/TypeScript/fm.liveswitch/UnixTimestamp.ts:34
dateTimeToUnixMillis
▸ Static
dateTimeToUnixMillis(dateTime
: DateTime): number
Converts a date to a Unix timestamp with millisecond precision.
Parameters:
Name | Type | Description |
---|---|---|
dateTime |
DateTime | The date to convert. |
Returns: number
The equivalent Unix timestamp.
Defined in: Generated/TypeScript/fm.liveswitch/UnixTimestamp.ts:49
getUtcNow
▸ Static
getUtcNow(): number
Gets the current UTC time in Unix format.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/UnixTimestamp.ts:62
getUtcNowMillis
▸ Static
getUtcNowMillis(): number
Gets the current UTC time in Unix format with millisecond precision.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/UnixTimestamp.ts:75
ticksToUnix
▸ Static
ticksToUnix(ticks
: number): number
Converts ticks to a Unix timestamp.
Parameters:
Name | Type | Description |
---|---|---|
ticks |
number | The ticks to convert. |
Returns: number
The equivalent Unix timestamp.
Defined in: Generated/TypeScript/fm.liveswitch/UnixTimestamp.ts:90
ticksToUnixMillis
▸ Static
ticksToUnixMillis(ticks
: number): number
Converts ticks to a Unix timestamp with millisecond precision.
Parameters:
Name | Type | Description |
---|---|---|
ticks |
number | The ticks to convert. |
Returns: number
The equivalent Unix timestamp.
Defined in: Generated/TypeScript/fm.liveswitch/UnixTimestamp.ts:106
unixMillisToDateTime
▸ Static
unixMillisToDateTime(unix
: number): DateTime
Converts a Unix timestamp with millisecond precision to a date.
Parameters:
Name | Type | Description |
---|---|---|
unix |
number | The Unix timestamp to convert. |
Returns: DateTime
The equivalent date.
Defined in: Generated/TypeScript/fm.liveswitch/UnixTimestamp.ts:122
unixMillisToTicks
▸ Static
unixMillisToTicks(unix
: number): number
Converts a Unix timestamp with millisecond precision to ticks.
Parameters:
Name | Type | Description |
---|---|---|
unix |
number | The Unix timestamp to convert. |
Returns: number
The equivalent ticks.
Defined in: Generated/TypeScript/fm.liveswitch/UnixTimestamp.ts:138
unixToDateTime
▸ Static
unixToDateTime(unix
: number): DateTime
Converts a Unix timestamp to a date.
Parameters:
Name | Type | Description |
---|---|---|
unix |
number | The Unix timestamp to convert. |
Returns: DateTime
The equivalent date.
Defined in: Generated/TypeScript/fm.liveswitch/UnixTimestamp.ts:154
unixToTicks
▸ Static
unixToTicks(unix
: number): number
Converts a Unix timestamp to ticks.
Parameters:
Name | Type | Description |
---|---|---|
unix |
number | The Unix timestamp to convert. |
Returns: number
The equivalent ticks.
Defined in: Generated/TypeScript/fm.liveswitch/UnixTimestamp.ts:170