Temporal
public enum Temporal
Temporal
is namespace to all temporal types and basic date operations. It can
not be directly instantiated.
Available Temporal
Specs
- Temporal.Date
- Temporal.DateTime
- Temporal.Time
-
Temporal.Date
represents aDate
with specific allowable formats..short
=>yyyy-MM-dd
.medium
=>yyyy-MM-ddZZZZZ
.long
=>yyyy-MM-ddZZZZZ
.full
=>yyyy-MM-ddZZZZZ
Note
.medium
,.long
, and.full
are the same date format.Declaration
Swift
public struct Date : TemporalSpec
extension Temporal.Date: Persistable
extension Temporal.Date: DateUnitOperable
extension Temporal.Date: Codable
extension Temporal.Date: Comparable
-
Temporal.DateTime
represents aDateTime
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 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.Time
represents aTime
with specific allowable formats..short
=>HH:mm
.medium
=>HH:mm:ss
.long
=>HH:mm:ss.SSS
.full
=>HH:mm:ss.SSSZZZZZ
Declaration
Swift
public struct Time : TemporalSpec
extension Temporal.Time: Persistable
extension Temporal.Time: Codable
extension Temporal.Time: Comparable
extension Temporal.Time: TimeUnitOperable