Enumeration

Calendar.Component

An enumeration for the various components of a calendar date.

Declaration

enum Calendar.Component

Overview

Several Calendar APIs use either a single unit or a set of units as input to a search algorithm.

See Also

Extracting Components

func date(Date, matchesComponents: DateComponents) -> Bool

Determines if the date has all of the specified date components.

func component(Calendar.Component, from: Date) -> Int

Returns the value for one component of a date.

func dateComponents(Set<Calendar.Component>, from: Date) -> DateComponents

Returns all the date components of a date, using the calendar time zone.

func dateComponents(in: TimeZone, from: Date) -> DateComponents

Returns all the date components of a date, as if in a given time zone (instead of the Calendar time zone).