HighPrecisionTime
public struct HighPrecisionTime
Represents a high precision timestamp starting from UNIX epoch: 1970-01-01
.
-
Current date represented in seconds passed since January 1st, 1970.
Declaration
Swift
public let secondsSince1970: Int -
Nanoseconds offset added to the current date.
Declaration
Swift
public let nanosecondsOffset: Int -
Declaration
Swift
public init(secondsSince1970: Int, nanosecondsOffset: Int = 0)Parameters
secondsSince1970Number of seconds passed January 1st, 1970
nanosecondsOffsetNanoseconds to be added to the initial date
-
Converts to a
Foundation.Date.Note
Truncates the nanosecond component.Declaration
Swift
public func toDate() -> Date
-
Converts a
Foundation.Dateinto an instance ofHighPrecisionTime.Note
Sub-second components default to 0.Declaration
Swift
public init(date: Date) -
Declaration
Swift
public init(secondsSince1970: Int, millisecondsOffset: Int)Parameters
secondsSince1970Number of seconds passed January 1st, 1970
millisecondsOffsetMilliseconds to be added to the initial date
-
Declaration
Swift
public init(secondsSince1970: Int, microsecondsOffset: Int)Parameters
secondsSince1970Number of seconds passed January 1st, 1970
microsecondsOffsetMicroseconds to be added to the initial date
-
Declaration
Swift
public var description: String
-
Declaration
Swift
public static func == (left: HighPrecisionTime, right: HighPrecisionTime) -> BoolParameters
lhsrhs
HighPrecisionTime Struct Reference