---
title: Calendar
framework: foundation
role: symbol
role_heading: Structure
path: foundation/calendar
---

# Calendar

A definition of the relationships between calendar units and absolute points in time, providing features for calculation and comparison of dates.

## Declaration

```swift
struct Calendar
```

## Overview

Overview Calendar encapsulates information about systems of reckoning time in which the beginning, length, and divisions of a year are defined. It provides information about the calendar and support for calendrical computations such as determining the range of a given calendrical unit and adding units to a given absolute time.

## Topics

### Creating a Calendar

- [Calendar.Identifier](foundation/calendar/identifier-swift.enum.md)

### Getting the User’s Calendar

- [autoupdatingCurrent](foundation/calendar/autoupdatingcurrent.md)
- [current](foundation/calendar/current.md)

### Extracting Components

- [date(_:matchesComponents:)](foundation/calendar/date(_:matchescomponents:).md)
- [component(_:from:)](foundation/calendar/component(_:from:).md)
- [dateComponents(_:from:)](foundation/calendar/datecomponents(_:from:).md)
- [dateComponents(_:from:to:)](foundation/calendar/datecomponents(_:from:to:)-2kcg.md)
- [dateComponents(_:from:to:)](foundation/calendar/datecomponents(_:from:to:)-5g20t.md)
- [dateComponents(in:from:)](foundation/calendar/datecomponents(in:from:).md)
- [Calendar.Component](foundation/calendar/component.md)

### Getting Calendar Information

- [identifier](foundation/calendar/identifier-swift.property.md)
- [locale](foundation/calendar/locale.md)
- [firstWeekday](foundation/calendar/firstweekday.md)
- [minimumDaysInFirstWeek](foundation/calendar/minimumdaysinfirstweek.md)
- [timeZone](foundation/calendar/timezone.md)
- [maximumRange(of:)](foundation/calendar/maximumrange(of:).md)
- [minimumRange(of:)](foundation/calendar/minimumrange(of:).md)
- [ordinality(of:in:for:)](foundation/calendar/ordinality(of:in:for:).md)
- [range(of:in:for:)](foundation/calendar/range(of:in:for:).md)

### Scanning Dates

- [startOfDay(for:)](foundation/calendar/startofday(for:).md)
- [enumerateDates(startingAfter:matching:matchingPolicy:repeatedTimePolicy:direction:using:)](foundation/calendar/enumeratedates(startingafter:matching:matchingpolicy:repeatedtimepolicy:direction:using:).md)
- [nextDate(after:matching:matchingPolicy:repeatedTimePolicy:direction:)](foundation/calendar/nextdate(after:matching:matchingpolicy:repeatedtimepolicy:direction:).md)
- [Calendar.MatchingPolicy](foundation/calendar/matchingpolicy.md)
- [Calendar.RepeatedTimePolicy](foundation/calendar/repeatedtimepolicy.md)

### Calculating Dates from Components

- [date(from:)](foundation/calendar/date(from:).md)
- [date(byAdding:to:wrappingComponents:)](foundation/calendar/date(byadding:to:wrappingcomponents:).md)
- [date(byAdding:value:to:wrappingComponents:)](foundation/calendar/date(byadding:value:to:wrappingcomponents:).md)
- [date(bySetting:value:of:)](foundation/calendar/date(bysetting:value:of:).md)
- [date(bySettingHour:minute:second:of:matchingPolicy:repeatedTimePolicy:direction:)](foundation/calendar/date(bysettinghour:minute:second:of:matchingpolicy:repeatedtimepolicy:direction:).md)

### Calculating Intervals

- [dateInterval(of:for:)](foundation/calendar/dateinterval(of:for:).md)
- [dateInterval(of:start:interval:for:)](foundation/calendar/dateinterval(of:start:interval:for:).md)
- [dateIntervalOfWeekend(containing:)](foundation/calendar/dateintervalofweekend(containing:).md)
- [dateIntervalOfWeekend(containing:start:interval:)](foundation/calendar/dateintervalofweekend(containing:start:interval:).md)
- [nextWeekend(startingAfter:direction:)](foundation/calendar/nextweekend(startingafter:direction:).md)
- [nextWeekend(startingAfter:start:interval:direction:)](foundation/calendar/nextweekend(startingafter:start:interval:direction:).md)
- [Calendar.SearchDirection](foundation/calendar/searchdirection.md)

### Comparing Dates

- [compare(_:to:toGranularity:)](foundation/calendar/compare(_:to:togranularity:).md)
- [isDate(_:equalTo:toGranularity:)](foundation/calendar/isdate(_:equalto:togranularity:).md)
- [isDate(_:inSameDayAs:)](foundation/calendar/isdate(_:insamedayas:).md)
- [isDateInToday(_:)](foundation/calendar/isdateintoday(_:).md)
- [isDateInTomorrow(_:)](foundation/calendar/isdateintomorrow(_:).md)
- [isDateInYesterday(_:)](foundation/calendar/isdateinyesterday(_:).md)
- [isDateInWeekend(_:)](foundation/calendar/isdateinweekend(_:).md)

### Getting AM and PM symbols

- [amSymbol](foundation/calendar/amsymbol.md)
- [pmSymbol](foundation/calendar/pmsymbol.md)

### Getting Weekday Symbols

- [weekdaySymbols](foundation/calendar/weekdaysymbols.md)
- [shortWeekdaySymbols](foundation/calendar/shortweekdaysymbols.md)
- [veryShortWeekdaySymbols](foundation/calendar/veryshortweekdaysymbols.md)
- [standaloneWeekdaySymbols](foundation/calendar/standaloneweekdaysymbols.md)
- [shortStandaloneWeekdaySymbols](foundation/calendar/shortstandaloneweekdaysymbols.md)
- [veryShortStandaloneWeekdaySymbols](foundation/calendar/veryshortstandaloneweekdaysymbols.md)

### Getting Month Symbols

- [monthSymbols](foundation/calendar/monthsymbols.md)
- [shortMonthSymbols](foundation/calendar/shortmonthsymbols.md)
- [veryShortMonthSymbols](foundation/calendar/veryshortmonthsymbols.md)
- [standaloneMonthSymbols](foundation/calendar/standalonemonthsymbols.md)
- [shortStandaloneMonthSymbols](foundation/calendar/shortstandalonemonthsymbols.md)
- [veryShortStandaloneMonthSymbols](foundation/calendar/veryshortstandalonemonthsymbols.md)

### Getting Quarter Symbols

- [quarterSymbols](foundation/calendar/quartersymbols.md)
- [shortQuarterSymbols](foundation/calendar/shortquartersymbols.md)
- [standaloneQuarterSymbols](foundation/calendar/standalonequartersymbols.md)
- [shortStandaloneQuarterSymbols](foundation/calendar/shortstandalonequartersymbols.md)

### Getting Era Symbols

- [eraSymbols](foundation/calendar/erasymbols.md)
- [longEraSymbols](foundation/calendar/longerasymbols.md)

### Working with notification messages

- [Calendar.CalendarDayChangedMessage](foundation/calendar/calendardaychangedmessage.md)

### Using Reference Types

- [NSCalendar](foundation/nscalendar.md)

### Structures

- [Calendar.RecurrenceRule](foundation/calendar/recurrencerule.md)

### Initializers

- [init(identifier:)](foundation/calendar/init(identifier:).md)

### Instance Methods

- [dates(byAdding:startingAt:in:wrappingComponents:)](foundation/calendar/dates(byadding:startingat:in:wrappingcomponents:).md)
- [dates(byAdding:value:startingAt:in:wrappingComponents:)](foundation/calendar/dates(byadding:value:startingat:in:wrappingcomponents:).md)
- [dates(byMatching:startingAt:in:matchingPolicy:repeatedTimePolicy:direction:)](foundation/calendar/dates(bymatching:startingat:in:matchingpolicy:repeatedtimepolicy:direction:).md)

## Relationships

### Conforms To

- [Copyable](swift/copyable.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomReflectable](swift/customreflectable.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Decodable](swift/decodable.md)
- [Encodable](swift/encodable.md)
- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [Hashable](swift/hashable.md)
- [ReferenceConvertible](foundation/referenceconvertible.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Calendrical Calculations

- [DateComponents](foundation/datecomponents.md)
- [TimeZone](foundation/timezone.md)
