---
title: "CFDateFormatterSetFormat(_:_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfdateformattersetformat(_:_:)"
---

# CFDateFormatterSetFormat(_:_:)

Sets the format string of the given date formatter to the specified value.

## Declaration

```swift
func CFDateFormatterSetFormat(_ formatter: CFDateFormatter!, _ formatString: CFString!)
```

## Parameters

- `formatter`: The date formatter to modify.
- `formatString`: The format string for formatter. The syntax of this string is defined by http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns..

## Discussion

Discussion The format string may override other properties previously set using other functions. If this function is not called, the default value of the format string is derived from the date formatter’s date and time styles.

## See Also

### Configuring a Date Formatter

- [CFDateFormatterSetProperty(_:_:_:)](corefoundation/cfdateformattersetproperty(_:_:_:).md)
