---
title: "CFDateFormatterCreateStringWithDate(_:_:_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfdateformattercreatestringwithdate(_:_:_:)"
---

# CFDateFormatterCreateStringWithDate(_:_:_:)

Returns a string representation of the given date using the specified date formatter.

## Declaration

```swift
func CFDateFormatterCreateStringWithDate(_ allocator: CFAllocator!, _ formatter: CFDateFormatter!, _ date: CFDate!) -> CFString!
```

## Parameters

- `allocator`: The allocator to use to allocate memory for the new object. Pass NULL or kCFAllocatorDefault to use the current default allocator.
- `formatter`: The date formatter object that specifies the format of the returned string.
- `date`: The date object for which to create a string representation.

## Return Value

Return Value A new string that represents date in the specified format. Returns NULL if there was a problem creating the object. Ownership follows the The Create Rule.

## See Also

### Creating Strings From Data

- [CFDateFormatterCreateStringWithAbsoluteTime(_:_:_:)](corefoundation/cfdateformattercreatestringwithabsolutetime(_:_:_:).md)
- [CFDateFormatterCreateDateFormatFromTemplate(_:_:_:_:)](corefoundation/cfdateformattercreatedateformatfromtemplate(_:_:_:_:).md)
