<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/CFDateFormatterSetFormat(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Foundation"
    ],
    "preciseIdentifier" : "c:@F@CFDateFormatterSetFormat"
  },
  "title" : "CFDateFormatterSetFormat(_:_:)"
}
-->

# CFDateFormatterSetFormat(_:_:)

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

```
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 [Unicode Technical Standard #35](http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns)..

## 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.

---

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)