iOS Developer Library

Developer

Foundation Framework Reference NSDateComponents Class Reference

Options
Deployment Target:

On This Page
Language:

NSDateComponents

NSDateComponents encapsulates the components of a date in an extendable, object-oriented manner. It is used to specify a date by providing the temporal components that make up a date and time: hour, minutes, seconds, day, month, year, and so on. It can also be used to specify a duration of time, for example, 5 hours and 16 minutes. An NSDateComponents object is not required to define all the component fields. When a new instance of NSDateComponents is created the date components are set to NSUndefinedDateComponent. More...

Inheritance


Import Statement


import Foundation @import Foundation;

Availability


Available in iOS 2.0 and later.
  • This constant specifies that an NSDateComponents component is undefined.

    Declaration

    Swift

    var NSUndefinedDateComponent: Int { get }

    Objective-C

    enum { NSUndefinedDateComponent = 0x7fffffff };

    Constants

    • NSUndefinedDateComponent

      NSUndefinedDateComponent

      Specifies that the component is undefined.

      Available in iOS 2.0 and later.

      Deprecated in iOS 8.0.

    Import Statement