---
title: "CGPDFStringCopyDate(_:)"
framework: coregraphics
role: symbol
role_heading: Function
path: "coregraphics/cgpdfstringcopydate(_:)"
---

# CGPDFStringCopyDate(_:)

Converts a string to a date.

## Declaration

```swift
func CGPDFStringCopyDate(_ string: CGPDFStringRef) -> CFDate?
```

## Parameters

- `string`: The string to convert to a date.

## Return Value

Return Value A CFDate object.

## Discussion

Discussion The PDF specification defines a specific format for strings that represent dates. This function converts strings in that form to CFDate objects.

## See Also

### Converting PDF Strings

- [CGPDFStringCopyTextString(_:)](coregraphics/cgpdfstringcopytextstring(_:).md)
