<!--
{
  "documentType" : "article",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/1430344-undefined-components",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Undefined Components"
}
-->

# Undefined Components

Constants that denote that the value of a date component is undefined.

## Discussion

For example, when an [`NSDateComponents`](/documentation/Foundation/NSDateComponents) object is created as the result of calculating the distance in time between two dates represented by a particular calendar, the value for the [`weekOfYear`](/documentation/Foundation/NSCalendar/Unit/weekOfYear) component would be set to [`NSDateComponentUndefined`](/documentation/Foundation/NSDateComponentUndefined).

## Topics

### Constants

[`var NSDateComponentUndefined: Int`](/documentation/Foundation/NSDateComponentUndefined)

Specifies a date component without a value.

[`var NSUndefinedDateComponent: Int`](/documentation/Foundation/NSUndefinedDateComponent)

Specifies a date component without a value.



---

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)