Utility class to assist with Unix timestamp conversions.
More...
Utility class to assist with Unix timestamp conversions.
◆ UnixTimestamp()
fm.liveswitch.UnixTimestamp.UnixTimestamp |
( |
| ) |
|
◆ dateTimeToUnix()
static long fm.liveswitch.UnixTimestamp.dateTimeToUnix |
( |
java.util.Date |
dateTime | ) |
|
|
static |
Converts a date to a Unix timestamp.
- Parameters
-
dateTime | The date to convert. |
- Returns
- The equivalent Unix timestamp.
◆ dateTimeToUnixMillis()
static long fm.liveswitch.UnixTimestamp.dateTimeToUnixMillis |
( |
java.util.Date |
dateTime | ) |
|
|
static |
Converts a date to a Unix timestamp with millisecond precision.
- Parameters
-
dateTime | The date to convert. |
- Returns
- The equivalent Unix timestamp.
◆ getUtcNow()
static long fm.liveswitch.UnixTimestamp.getUtcNow |
( |
| ) |
|
|
static |
Gets the current UTC time in Unix format.
◆ getUtcNowMillis()
static long fm.liveswitch.UnixTimestamp.getUtcNowMillis |
( |
| ) |
|
|
static |
Gets the current UTC time in Unix format with millisecond precision.
◆ ticksToUnix()
static long fm.liveswitch.UnixTimestamp.ticksToUnix |
( |
long |
ticks | ) |
|
|
static |
Converts ticks to a Unix timestamp.
- Parameters
-
ticks | The ticks to convert. |
- Returns
- The equivalent Unix timestamp.
◆ ticksToUnixMillis()
static long fm.liveswitch.UnixTimestamp.ticksToUnixMillis |
( |
long |
ticks | ) |
|
|
static |
Converts ticks to a Unix timestamp with millisecond precision.
- Parameters
-
ticks | The ticks to convert. |
- Returns
- The equivalent Unix timestamp.
◆ unixMillisToDateTime()
static java.util.Date fm.liveswitch.UnixTimestamp.unixMillisToDateTime |
( |
long |
unix | ) |
|
|
static |
Converts a Unix timestamp with millisecond precision to a date.
- Parameters
-
unix | The Unix timestamp to convert. |
- Returns
- The equivalent date.
◆ unixMillisToTicks()
static long fm.liveswitch.UnixTimestamp.unixMillisToTicks |
( |
long |
unix | ) |
|
|
static |
Converts a Unix timestamp with millisecond precision to ticks.
- Parameters
-
unix | The Unix timestamp to convert. |
- Returns
- The equivalent ticks.
◆ unixToDateTime()
static java.util.Date fm.liveswitch.UnixTimestamp.unixToDateTime |
( |
long |
unix | ) |
|
|
static |
Converts a Unix timestamp to a date.
- Parameters
-
unix | The Unix timestamp to convert. |
- Returns
- The equivalent date.
◆ unixToTicks()
static long fm.liveswitch.UnixTimestamp.unixToTicks |
( |
long |
unix | ) |
|
|
static |
Converts a Unix timestamp to ticks.
- Parameters
-
unix | The Unix timestamp to convert. |
- Returns
- The equivalent ticks.