Up

# NSDateComponentsFormatter class documentation

### Authors

Gregory Casamento (`greg.casamento@gmail.com`)

Date: Generated at 2025-02-13 06:02:40 +0000

Copyright: (C) 2019 Free Software Foundation, Inc.

# Software documentation for the NSDateComponentsFormatter class

## NSDateComponentsFormatter : NSFormatter

> Declared in:
>   Foundation/NSDateComponentsFormatter.h

Availability: Not in OpenStep/MacOS-X
Description forthcoming.

Instance Variables
Method summary

- +localizedStringFromDateComponents:unitsStyle:
- -allowedUnits
- -allowsFractionalUnits
- -calendar
- -collapsesLargestUnit
- -formattingContext
- -getObjectValue:forString:errorDescription:
- -includesApproximationPhrase
- -maximumUnitCount
- -referenceDate
- -setAllowedUnits:
- -setAllowsFractionalUnits:
- -setCalender:
- -setCollapsesLargestUnit:
- -setFormattingContext:
- -setIncludesApproximationPhrase:
- -setMaximumUnitCount:
- -setReferenceDate:
- -setUnitsStyle:
- -setZeroFormattingBehavior:
- -stringForObjectValue:
- -stringFromDate:toDate:
- -stringFromDateComponents:
- -stringFromTimeInterval:
- -unitsStyle
- -zeroFormattingBehavior

### localizedStringFromDateComponents: unitsStyle:

+ (NSString*) localizedStringFromDateComponents: (NSDateComponents*)components unitsStyle: (NSDateComponentsFormatterUnitsStyle)unitsStyle;
Availability: Not in OpenStep/MacOS-X
Description forthcoming.

### allowedUnits

- (NSCalendarUnit) allowedUnits;
Availability: Not in OpenStep/MacOS-X
Description forthcoming.

### allowsFractionalUnits

- (BOOL) allowsFractionalUnits;
Availability: Not in OpenStep/MacOS-X
Description forthcoming.

### calendar

- (NSCalendar*) calendar;
Availability: Not in OpenStep/MacOS-X
Description forthcoming.

### collapsesLargestUnit

- (BOOL) collapsesLargestUnit;
Availability: Not in OpenStep/MacOS-X
Description forthcoming.

### formattingContext

- (NSFormattingContext) formattingContext;
Availability: Not in OpenStep/MacOS-X
Description forthcoming.

### getObjectValue: forString: errorDescription:

- (BOOL) getObjectValue: (id*)obj forString: (NSString*)string errorDescription: (NSString**)error;
Availability: Not in OpenStep/MacOS-X
Description forthcoming.

### includesApproximationPhrase

- (BOOL) includesApproximationPhrase;
Availability: Not in OpenStep/MacOS-X
Description forthcoming.

### maximumUnitCount

- (NSInteger) maximumUnitCount;
Availability: Not in OpenStep/MacOS-X
Description forthcoming.

### referenceDate

- (NSDate*) referenceDate;
Availability: Not in OpenStep/MacOS-X
Description forthcoming.

### setAllowedUnits:

- (void) setAllowedUnits: (NSCalendarUnit)units;
Availability: Not in OpenStep/MacOS-X
Description forthcoming.

### setAllowsFractionalUnits:

- (void) setAllowsFractionalUnits: (BOOL)allowsFractionalUnits;
Availability: Not in OpenStep/MacOS-X
Description forthcoming.

### setCalender:

- (void) setCalender: (NSCalendar*)calendar;
Availability: Not in OpenStep/MacOS-X
Description forthcoming.

### setCollapsesLargestUnit:

- (void) setCollapsesLargestUnit: (BOOL)collapsesLargestUnit;
Availability: Not in OpenStep/MacOS-X
Description forthcoming.

### setFormattingContext:

- (void) setFormattingContext: (NSFormattingContext)formattingContext;
Availability: Not in OpenStep/MacOS-X
Description forthcoming.

### setIncludesApproximationPhrase:

- (void) setIncludesApproximationPhrase: (BOOL)includesApproximationPhrase;
Availability: Not in OpenStep/MacOS-X
Description forthcoming.

### setMaximumUnitCount:

- (void) setMaximumUnitCount: (NSInteger)maximumUnitCount;
Availability: Not in OpenStep/MacOS-X
Description forthcoming.

### setReferenceDate:

- (void) setReferenceDate: (NSDate*)referenceDate;
Availability: Not in OpenStep/MacOS-X
Description forthcoming.

### setUnitsStyle:

- (void) setUnitsStyle: (NSDateComponentsFormatterUnitsStyle)style;
Availability: Not in OpenStep/MacOS-X
Description forthcoming.

### setZeroFormattingBehavior:

- (void) setZeroFormattingBehavior: (NSDateComponentsFormatterZeroFormattingBehavior)behavior;
Availability: Not in OpenStep/MacOS-X
Description forthcoming.

### stringForObjectValue:

- (NSString*) stringForObjectValue: (id)obj;
Availability: Not in OpenStep/MacOS-X
Description forthcoming.

### stringFromDate: toDate:

- (NSString*) stringFromDate: (NSDate*)startDate toDate: (NSDate*)endDate;
Availability: Not in OpenStep/MacOS-X
Description forthcoming.

### stringFromDateComponents:

- (NSString*) stringFromDateComponents: (NSDateComponents*)components;
Availability: Not in OpenStep/MacOS-X
Description forthcoming.

### stringFromTimeInterval:

- (NSString*) stringFromTimeInterval: (NSTimeInterval)ti;
Availability: Not in OpenStep/MacOS-X
Description forthcoming.

### unitsStyle

- (NSDateComponentsFormatterUnitsStyle) unitsStyle;
Availability: Not in OpenStep/MacOS-X
Description forthcoming.

### zeroFormattingBehavior

- (NSDateComponentsFormatterZeroFormattingBehavior) zeroFormattingBehavior;
Availability: Not in OpenStep/MacOS-X
Description forthcoming.

## Instance Variables for NSDateComponentsFormatter Class

### _allowedUnits

@protected NSCalendarUnit _allowedUnits;
Availability: Not in OpenStep/MacOS-X
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _allowsFractionalUnits

@protected BOOL _allowsFractionalUnits;
Availability: Not in OpenStep/MacOS-X
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _calendar

@protected NSCalendar* _calendar;
Availability: Not in OpenStep/MacOS-X
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _collapsesLargestUnit

@protected BOOL _collapsesLargestUnit;
Availability: Not in OpenStep/MacOS-X
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _formattingContext

@protected NSFormattingContext _formattingContext;
Availability: Not in OpenStep/MacOS-X
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _includesApproximationPhrase

@protected BOOL _includesApproximationPhrase;
Availability: Not in OpenStep/MacOS-X
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _maximumUnitCount

@protected NSInteger _maximumUnitCount;
Availability: Not in OpenStep/MacOS-X
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _referenceDate

@protected NSDate* _referenceDate;
Availability: Not in OpenStep/MacOS-X
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _unitsStyle

@protected NSDateComponentsFormatterUnitsStyle _unitsStyle;
Availability: Not in OpenStep/MacOS-X
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _zeroFormattingBehavior

@protected NSDateComponentsFormatterZeroFormattingBehavior _zeroFormattingBehavior;
Availability: Not in OpenStep/MacOS-X
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

Up