Instance Method

date(era:year:month:day:hour:minute:second:nanosecond:)

Returns a date created with the given components.

Declaration

func date(era eraValue: Int, year yearValue: Int, month monthValue: Int, day dayValue: Int, hour hourValue: Int, minute minuteValue: Int, second secondValue: Int, nanosecond nanosecondValue: Int) -> Date?

Parameters

eraValue

The value to set for the era.

yearValue

The value to set for the year.

monthValue

The value to set for the month.

dayValue

The value to set for the day.

hourValue

The value to set for the hour.

minuteValue

The value to set for the minute.

secondValue

The value to set for the second.

nanosecondValue

The value to set for the nanosecond.

Return Value

A new NSDate instance created with the given components, or nil if the components do not correspond to a valid date.

See Also

Calculating Dates

func date(from: DateComponents)

Returns a date representing the absolute time calculated from given components.

func date(byAdding: DateComponents, to: Date, options: NSCalendar.Options = [])

Returns a date representing the absolute time calculated by adding given components to a given date.

func date(byAdding: NSCalendar.Unit, value: Int, to: Date, options: NSCalendar.Options = [])

Returns a date representing the absolute time calculated by adding the value of a given component to a given date.

func date(bySettingUnit: NSCalendar.Unit, value: Int, of: Date, options: NSCalendar.Options = [])

Returns a new date representing the date calculated by setting a specific component of a given date to a given value, while trying to keep lower components the same.

func nextWeekendStart(AutoreleasingUnsafeMutablePointer<NSDate?>?, interval: UnsafeMutablePointer<TimeInterval>?, options: NSCalendar.Options = [], after: Date)

Returns by reference the starting date and time interval range of the next weekend period after a given date.