init()
Returns a Date
initialized to the current date and time.
init<T>(T.ParseInput, strategy: T) throws
init<T, Value>(Value, strategy: T) throws
init(from: any Decoder) throws
init(timeInterval: TimeInterval, since: Date)
Returns a Date
initialized relative to another given date by a given number of seconds.
init(timeIntervalSince1970: TimeInterval)
Returns a Date
initialized relative to 00:00:00 UTC on 1 January 1970 by a given number of seconds.
init(timeIntervalSinceNow: TimeInterval)
Returns a Date
initialized relative to the current date and time by a given number of seconds.
init(timeIntervalSinceReferenceDate: TimeInterval)
Returns a Date
initialized relative to 00:00:00 UTC on 1 January 2001 by a given number of seconds.
static let distantFuture: Date
Creates and returns a Date value representing a date in the distant future.
static let distantPast: Date
Creates and returns a Date value representing a date in the distant past.
static var now: Date
Returns a Date
initialized to the current date and time.
static let timeIntervalBetween1970AndReferenceDate: TimeInterval
The number of seconds from 1 January 1970 to the reference date, 1 January 2001.
static var timeIntervalSinceReferenceDate: TimeInterval
The interval between 00:00:00 UTC on 1 January 2001 and the current date and time.
static let validCalendarRange: ClosedRange<Date>
static func + (lhs: Date, rhs: TimeInterval) -> Date
Returns a Date
with a specified amount of time added to it.
static func += (lhs: inout Date, rhs: TimeInterval)
Add a TimeInterval
to a Date
.
static func - (lhs: Date, rhs: TimeInterval) -> Date
Returns a Date
with a specified amount of time subtracted from it.
static func -= (lhs: inout Date, rhs: TimeInterval)
Subtract a TimeInterval
from a Date
.
static func < (lhs: Date, rhs: Date) -> Bool
Returns true if the left hand Date
is earlier in time than the right hand Date
.
static func == (lhs: Date, rhs: Date) -> Bool
Returns true if the two Date
values represent the same point in time.
static func > (lhs: Date, rhs: Date) -> Bool
Returns true if the left hand Date
is later in time than the right hand Date
.