FMLiveSwitchUnixTimestamp Class Reference

Utility class to assist with Unix timestamp conversions. More...

Instance Methods

(instancetype) - init
 

Class Methods

(long long) + dateTimeToUnixMillisWithDateTime:
 Converts a date to a Unix timestamp with millisecond precision. More...
 
(long long) + dateTimeToUnixWithDateTime:
 Converts a date to a Unix timestamp. More...
 
(long long) + ticksToUnixMillisWithTicks:
 Converts ticks to a Unix timestamp with millisecond precision. More...
 
(long long) + ticksToUnixWithTicks:
 Converts ticks to a Unix timestamp. More...
 
(NSDate *) + unixMillisToDateTimeWithUnix:
 Converts a Unix timestamp with millisecond precision to a date. More...
 
(long long) + unixMillisToTicksWithUnix:
 Converts a Unix timestamp with millisecond precision to ticks. More...
 
(FMLiveSwitchUnixTimestamp *) + unixTimestamp
 
(NSDate *) + unixToDateTimeWithUnix:
 Converts a Unix timestamp to a date. More...
 
(long long) + unixToTicksWithUnix:
 Converts a Unix timestamp to ticks. More...
 
(long long) + utcNow
 Gets the current UTC time in Unix format. More...
 
(long long) + utcNowMillis
 Gets the current UTC time in Unix format with millisecond precision. More...
 

Detailed Description

Utility class to assist with Unix timestamp conversions.

Method Documentation

◆ dateTimeToUnixMillisWithDateTime:

+ (long long) dateTimeToUnixMillisWithDateTime: (NSDate *)  dateTime

Converts a date to a Unix timestamp with millisecond precision.

Parameters
dateTimeThe date to convert.
Returns
The equivalent Unix timestamp.

◆ dateTimeToUnixWithDateTime:

+ (long long) dateTimeToUnixWithDateTime: (NSDate *)  dateTime

Converts a date to a Unix timestamp.

Parameters
dateTimeThe date to convert.
Returns
The equivalent Unix timestamp.

◆ init

- (instancetype) init

◆ ticksToUnixMillisWithTicks:

+ (long long) ticksToUnixMillisWithTicks: (long long)  ticks

Converts ticks to a Unix timestamp with millisecond precision.

Parameters
ticksThe ticks to convert.
Returns
The equivalent Unix timestamp.

◆ ticksToUnixWithTicks:

+ (long long) ticksToUnixWithTicks: (long long)  ticks

Converts ticks to a Unix timestamp.

Parameters
ticksThe ticks to convert.
Returns
The equivalent Unix timestamp.

◆ unixMillisToDateTimeWithUnix:

+ (NSDate*) unixMillisToDateTimeWithUnix: (long long)  unix

Converts a Unix timestamp with millisecond precision to a date.

Parameters
unixThe Unix timestamp to convert.
Returns
The equivalent date.

◆ unixMillisToTicksWithUnix:

+ (long long) unixMillisToTicksWithUnix: (long long)  unix

Converts a Unix timestamp with millisecond precision to ticks.

Parameters
unixThe Unix timestamp to convert.
Returns
The equivalent ticks.

◆ unixTimestamp

+ (FMLiveSwitchUnixTimestamp*) unixTimestamp

◆ unixToDateTimeWithUnix:

+ (NSDate*) unixToDateTimeWithUnix: (long long)  unix

Converts a Unix timestamp to a date.

Parameters
unixThe Unix timestamp to convert.
Returns
The equivalent date.

◆ unixToTicksWithUnix:

+ (long long) unixToTicksWithUnix: (long long)  unix

Converts a Unix timestamp to ticks.

Parameters
unixThe Unix timestamp to convert.
Returns
The equivalent ticks.

◆ utcNow

+ (long long) utcNow

Gets the current UTC time in Unix format.

◆ utcNowMillis

+ (long long) utcNowMillis

Gets the current UTC time in Unix format with millisecond precision.