Instance Method

setLocalizedDateFormatFromTemplate:

Sets the date format from a template using the specified locale for the receiver.

Declaration

- (void)setLocalizedDateFormatFromTemplate:(NSString *)dateFormatTemplate;

Parameters

dateFormatTemplate

A string containing date format patterns (such as “MM” or “h”).

For full details, see Date and Time Programming Guide.

Discussion

See Data Formatting Guide for a list of the conversion specifiers permitted in date format strings.

Calling this method is equivalent to, but not necessarily implemented as, setting the dateFormat property to the result of calling the dateFormatFromTemplate:options:locale: method, passing no options and the locale property value.

See Also

Managing Formats and Styles

dateStyle

The date style of the receiver.

timeStyle

The time style of the receiver.

dateFormat

The date format string used by the receiver.

+ dateFormatFromTemplate:options:locale:

Returns a localized date format string representing the given date format components arranged appropriately for the specified locale.

formattingContext

The capitalization formatting context used when formatting a date.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software