---
title: "verbatim(_:locale:timeZone:calendar:)"
framework: foundation
role: symbol
role_heading: Type Method
path: "foundation/formatstyle/verbatim(_:locale:timezone:calendar:)"
---

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

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

## Declaration

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

## Parameters

- `format`: A doc://com.apple.foundation/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

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

## Discussion

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 to get a localized Date.FormatStyle instead. To use the ISO-8601 standard, use FormatStyle/iso8601 to get a Date.ISO8601FormatStyle. Use the dot-notation form of this type method when the call point allows the use of Date.VerbatimFormatStyle. You typically do this when calling the formatted(_:) method of 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. 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

## See Also

### Applying date and time styles

- [dateTime](foundation/formatstyle/datetime.md)
- [Date.FormatStyle](foundation/date/formatstyle.md)
- [Date.ISO8601FormatStyle](foundation/date/iso8601formatstyle.md)
- [Date.VerbatimFormatStyle](foundation/date/verbatimformatstyle.md)
- [interval](foundation/formatstyle/interval.md)
- [Date.IntervalFormatStyle](foundation/date/intervalformatstyle.md)
- [relative(presentation:unitsStyle:)](foundation/formatstyle/relative(presentation:unitsstyle:).md)
- [Date.RelativeFormatStyle](foundation/date/relativeformatstyle.md)
- [components(style:fields:)](foundation/formatstyle/components(style:fields:).md)
- [Date.ComponentsFormatStyle](foundation/date/componentsformatstyle.md)
