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

# CFDateCompare(_:_:_:)

Compares two `CFDate` objects and returns a comparison result.

```
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

A [`CFComparisonResult`](/documentation/CoreFoundation/CFComparisonResult) value that indicates whether `theDate` is equal to, less than, or greater than `otherDate`.

## Discussion

---

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)