CoatyTimestamp
public struct CoatyTimestamp
Utility functions to cope with the Coaty compatible timestamp format. In
Coaty, a timestamp defines the number of milliseconds elapsed since January
1, 1970, 00:00:00 UTC. In Swift, a Coaty timestamp should be represented as
a Double value.
-
Gets the Coaty compatible timestamp for the current date.
Declaration
Swift
public static func nowMillis() -> DoubleReturn Value
a Coaty timestamp representing number of milliseconds elapsed since January 1, 1970, 00:00:00 UTC, as a Double value.
-
Gets the Coaty compatible timestamp for the given
Date.Declaration
Swift
public static func dateMillis(from: Date) -> DoubleReturn Value
a Coaty timestamp representing number of milliseconds elapsed since January 1, 1970, 00:00:00 UTC for the given
Date, as a Double value. -
Gets the
Datefor the given Coaty compatible timestamp.Declaration
Swift
public static func date(from: Double) -> DateReturn Value
a
Datethat represents the given Coaty timestamp representing number of milliseconds elapsed since January 1, 1970, 00:00:00 UTC, as a Double value.
View on GitHub
CoatyTimestamp Structure Reference