<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/CFDate",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Core Foundation"
    ],
    "preciseIdentifier" : "c:@T@CFDateRef"
  },
  "title" : "CFDate"
}
-->

# CFDate

```
class CFDate
```

## Overview

`CFDate` objects store dates and times that can be compared to other dates and times. `CFDate` objects are immutable—there is no mutable counterpart for this opaque type.

`CFDate` provides functions for creating dates, comparing dates, and computing intervals. You use the [`CFDateCreate(_:_:)`](/documentation/CoreFoundation/CFDateCreate(_:_:)) function to create `CFDate` objects. You use the [`CFDateCompare(_:_:_:)`](/documentation/CoreFoundation/CFDateCompare(_:_:_:)) function to compare two dates, and the [`CFDateGetTimeIntervalSinceDate(_:_:)`](/documentation/CoreFoundation/CFDateGetTimeIntervalSinceDate(_:_:)) function to compute a time interval. Additional functions for managing dates and times are described in [Time Utilities](/documentation/CoreFoundation/time-utilities)

`CFDate` is “toll-free bridged” with its Cocoa Foundation counterpart, <doc://com.apple.documentation/documentation/Foundation/NSDate>. What this means is that the Core Foundation type is interchangeable in function or method calls with the bridged Foundation object. In other words, in a method where you see an `NSDate *` parameter, you can pass in a `CFDateRef`, and in a function where you see a `CFDateRef` parameter, you can pass in an `NSDate` instance. This also applies to concrete subclasses of `NSDate`. See Interchangeable Data Types for more information on toll-free bridging.

## Topics

### CFDate Miscellaneous Functions

[`CFDateCompare(_:_:_:)`](/documentation/CoreFoundation/CFDateCompare(_:_:_:))

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

[`CFDateCreate(_:_:)`](/documentation/CoreFoundation/CFDateCreate(_:_:))

Creates a `CFDate` object given an absolute time.

[`CFDateGetAbsoluteTime(_:)`](/documentation/CoreFoundation/CFDateGetAbsoluteTime(_:))

Returns a `CFDate` object’s absolute time.

[`CFDateGetTimeIntervalSinceDate(_:_:)`](/documentation/CoreFoundation/CFDateGetTimeIntervalSinceDate(_:_:))

Returns the number of elapsed seconds between the given `CFDate` objects.

[`CFDateGetTypeID()`](/documentation/CoreFoundation/CFDateGetTypeID())

Returns the type identifier for the `CFDate` opaque type.

## See Also

  [Property List Programming Topics for Core Foundation](https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFPropertyLists/CFPropertyLists.html#//apple_ref/doc/uid/10000130i)

  [Date and Time Programming Guide for Core Foundation](https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFDatesAndTimes/CFDatesAndTimes.html#//apple_ref/doc/uid/10000125i)



---

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)