DateTime
public struct DateTime : TemporalSpec
extension Temporal.DateTime: Persistable
extension Temporal.DateTime: DateUnitOperable, TimeUnitOperable
extension Temporal.DateTime: Sendable
extension Temporal.DateTime: Codable
extension Temporal.DateTime: Comparable
Temporal.DateTime
represents a DateTime
with specific allowable formats.
.short
=>yyyy-MM-dd'T'HH:mm
.medium
=>yyyy-MM-dd'T'HH:mm:ss
.long
=>yyyy-MM-dd'T'HH:mm:ssZZZZZ
.full
=>yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ
-
Declaration
Swift
public let foundationDate: Foundation.Date
-
Declaration
Swift
public let timeZone: TimeZone?
-
Declaration
Swift
public static func now() -> Temporal.DateTime
-
Temporal.Time
of thisTemporal.DateTime
.Declaration
Swift
public var time: Time { get }
-
Declaration
Swift
public init(_ date: Foundation.Date, timeZone: TimeZone? = .utc)