---
title: "CFDateCompare(_:_:_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfdatecompare(_:_:_:)"
---

# CFDateCompare(_:_:_:)

Compares two CFDate objects and returns a comparison result.

## Declaration

```swift
func CFDateCompare(_ theDate: CFDate!, _ otherDate: CFDate!, _ context: UnsafeMutableRawPointer!) -> CFComparisonResult
```

## Parameters

- `theDate`: The date to compare to otherDate.
- `otherDate`: The date to compare to theDate.
- `context`: Unused. Pass NULL.

## Return Value

Return Value A CFComparisonResult value that indicates whether theDate is equal to, less than, or greater than otherDate.

## See Also

### CFDate Miscellaneous Functions

- [CFDateCreate(_:_:)](corefoundation/cfdatecreate(_:_:).md)
- [CFDateGetAbsoluteTime(_:)](corefoundation/cfdategetabsolutetime(_:).md)
- [CFDateGetTimeIntervalSinceDate(_:_:)](corefoundation/cfdategettimeintervalsincedate(_:_:).md)
- [CFDateGetTypeID()](corefoundation/cfdategettypeid().md)
