---
title: "init(date:time:locale:calendar:timeZone:capitalizationContext:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/date/formatstyle/init(date:time:locale:calendar:timezone:capitalizationcontext:)"
---

# init(date:time:locale:calendar:timeZone:capitalizationContext:)

Creates an instance using the provided date, time, locale, calendar, time zone, and capitalization context.

## Declaration

```swift
init(date: Date.FormatStyle.DateStyle? = nil, time: Date.FormatStyle.TimeStyle? = nil, locale: Locale = .autoupdatingCurrent, calendar: Calendar = .autoupdatingCurrent, timeZone: TimeZone = .autoupdatingCurrent, capitalizationContext: FormatStyleCapitalizationContext = .unknown)
```

## Parameters

- `date`: The doc://com.apple.foundation/documentation/Foundation/Date/FormatStyle/DateStyle used to create the string representation of the date.
- `time`: The doc://com.apple.foundation/documentation/Foundation/Date/FormatStyle/TimeStyle used to create the string representation of the date.
- `locale`: The doc://com.apple.foundation/documentation/Foundation/Locale used to create the string representation of the date.
- `calendar`: The doc://com.apple.foundation/documentation/Foundation/Calendar used to create the string representation of the date.
- `timeZone`: The doc://com.apple.foundation/documentation/Foundation/TimeZone used to create the string representation of the date.
- `capitalizationContext`: The doc://com.apple.foundation/documentation/Foundation/FormatStyleCapitalizationContext used to create the string representation of the date.

## Discussion

Discussion Customize the date string by providing a date style, time style, locale, calendar, time zone, and capitalization scheme. Date style values are complete, long, abbreviated, numeric, omitted, or none. Time style values are complete, standard, shortened, omitted, or none.
