<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/Date/FormatStyle/Symbol/Day",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation4DateV11FormatStyleV6SymbolV3DayV"
  },
  "title" : "Date.FormatStyle.Symbol.Day"
}
-->

# Date.FormatStyle.Symbol.Day

A type that specifies the format for a day in a date format style.

```
struct Day
```

## Overview

The [`Date.FormatStyle.Symbol.Day`](/documentation/Foundation/Date/FormatStyle/Symbol/Day) type includes static factory variables and methods that create custom [`Date.FormatStyle.Symbol.Day`](/documentation/Foundation/Date/FormatStyle/Symbol/Day) objects:

|Factory variable                                                                                                  |Description                                                                                                                        |
|------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|
|``doc://com.apple.foundation/documentation/Foundation/Date/FormatStyle/Symbol/Day/defaultDigits``                 |The minimum number of digits that shows the numeric day of month. For example, `1`, `18`.                                          |
|``doc://com.apple.foundation/documentation/Foundation/Date/FormatStyle/Symbol/Day/julianModified(minimumLength:)``|The modified Julian day. The field length specifies the minimum number of digits, zero-padded if necessary. For example, `2451334`.|
|``doc://com.apple.foundation/documentation/Foundation/Date/FormatStyle/Symbol/Day/ordinalOfDayInMonth``           |The ordinal of the day in the month. For example, the second Wednesday in July would yield `2`.                                    |
|``doc://com.apple.foundation/documentation/Foundation/Date/FormatStyle/Symbol/Day/twoDigits``                     |The two-digit numeric day of month, zero-padded if necessary. For example, `01`, `18`.                                             |

To customize the day format in a string representation of a `Date`, use [`day(_:)`](/documentation/Foundation/Date/FormatStyle/day(_:)). The following example shows a variety of [`Date.FormatStyle.Symbol.Day`](/documentation/Foundation/Date/FormatStyle/Symbol/Day) formats applied to a date.

```swift
let meetingDate = Date() // Feb 9, 2021 at 3:00 PM
meetingDate.formatted(Date.FormatStyle().day(.defaultDigits)) // 9
meetingDate.formatted(Date.FormatStyle().day(.ordinalOfDayInMonth)) // 2 (second Tuesday of the month)
meetingDate.formatted(Date.FormatStyle().day(.twoDigits)) // 09
meetingDate.formatted(Date.FormatStyle().day(.julianModified(minimumLength: 12))) // 0002459255
meetingDate.formatted(Date.FormatStyle().day()) // 9
```

If no format is specified as a parameter, the [`defaultDigits`](/documentation/Foundation/Date/FormatStyle/Symbol/Day/defaultDigits) static variable is the default format.

For more information about formatting dates, see the [`Date.FormatStyle`](/documentation/Foundation/Date/FormatStyle).

## Topics

### Modifying a Day Format

[`static var defaultDigits: Date.FormatStyle.Symbol.Day`](/documentation/Foundation/Date/FormatStyle/Symbol/Day/defaultDigits)

Custom format style portraying the minimum number of digits that represents the numeric day of month.

[`static var ordinalOfDayInMonth: Date.FormatStyle.Symbol.Day`](/documentation/Foundation/Date/FormatStyle/Symbol/Day/ordinalOfDayInMonth)

Custom format style portraying the ordinal of the day in the month.

[`static var twoDigits: Date.FormatStyle.Symbol.Day`](/documentation/Foundation/Date/FormatStyle/Symbol/Day/twoDigits)

Custom format style portraying the two-digit numeric day of month, zero-padded if necessary.

[`static func julianModified(minimumLength: Int) -> Date.FormatStyle.Symbol.Day`](/documentation/Foundation/Date/FormatStyle/Symbol/Day/julianModified(minimumLength:))

Creates a custom day format style representing the modified Julian day.

### Comparing Day Formats

[`static func == (Date, Date) -> Bool`](/documentation/Foundation/Date/==(_:_:))

Returns true if the two `Date` values represent the same point in time.

### Type Properties

[`static let omitted: Date.FormatStyle.Symbol.Day`](/documentation/Foundation/Date/FormatStyle/Symbol/Day/omitted)

The option for not including the symbol in the formatted output.

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Hashable`](/documentation/Swift/Hashable)

[`Equatable`](/documentation/Swift/Equatable)

[`Sendable`](/documentation/Swift/Sendable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)