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

# CFGregorianDateIsValid(_:_:)

Checks the specified fields of a CFGregorianDate structure for valid values.

```
func CFGregorianDateIsValid(_ gdate: CFGregorianDate, _ unitFlags: CFOptionFlags) -> Bool
```

## Parameters

`gdate`

The CFGregorianDate structure whose fields to validate.

`unitFlags`

A mask that specifies which Gregorian unit fields to validate. See [`CFGregorianUnitFlags`](/documentation/CoreFoundation/CFGregorianUnitFlags) for a list of values from which to construct the mask.

## Return Value

`true` if the specified fields are valid, otherwise `false`.

## 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)