<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/FormatStyle/verbatim(_:locale:timeZone:calendar:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation11FormatStylePA2A4DateV08VerbatimbC0VRszrlE8verbatim_6locale8timeZone8calendarAgE0B6StringV_AA6LocaleVSgAA04TimeI0VAA8CalendarVtFZ"
  },
  "title" : "verbatim(_:locale:timeZone:calendar:)"
}
-->

# verbatim(_:locale:timeZone:calendar:)

Returns a style for formatting a date with an explicitly-specified style.

```
static func verbatim(_ format: Date.FormatString, locale: Locale? = nil, timeZone: TimeZone, calendar: Calendar) -> Date.VerbatimFormatStyle
```

## Parameters

`format`

A [`Date.FormatString`](/documentation/Foundation/Date/FormatString) that provides the explicit components and their respective styles to use when formatting a date.

`locale`

The locale to use when formatting. Defaults to `nil`.

`timeZone`

The time zone to use when formatting.

`calendar`

The calendar to use when formatting.

## Return Value

A date format style that uses the provided format string and timekeeping parameters.

## Discussion

Use this format style only when you need to produce or parse an exact format, such as when working with programmatically-produced date strings. For formatting dates that people read, use [`dateTime`](/documentation/Foundation/FormatStyle/dateTime) to get a localized [`Date.FormatStyle`](/documentation/Foundation/Date/FormatStyle) instead. To use the ISO-8601 standard, use `FormatStyle/iso8601` to get a [`Date.ISO8601FormatStyle`](/documentation/Foundation/Date/ISO8601FormatStyle).

Use the dot-notation form of this type method when the call point allows the use of [`Date.VerbatimFormatStyle`](/documentation/Foundation/Date/VerbatimFormatStyle). You typically do this when calling the [`formatted(_:)`](/documentation/Foundation/Date/formatted(_:)) method of [`Date`](/documentation/Foundation/Date).

The following example formats the current date with a verbatim format that uses a two-digit month, two-digit day, and default-digits year, separated by slashes. The format style zero-pads the month and day components. This style isn’t localized — while this format string mimicks `en_US` conventions, it uses this format in any locale, ignoring locale-apporpriate conventions.

```swift
let date = Date()
let formatted = date.formatted(
    .verbatim("\(month: .twoDigits)/\(day: .twoDigits)/\(year: .defaultDigits)" as Date.FormatString,
              locale: .autoupdatingCurrent,
              timeZone: .current,
              calendar: .current)) // 12/05/2022
```

---

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)