Creates and returns a date object set to the date and time specified by a given string.
- macOS 10.4–10.10Deprecated
A string that contains a colloquial specification of a date, such as “last Tuesday at dinner,” “3pm December 31, 2001,” “12/31/01,” or “31/12/01.”
NSDictionaryobject containing locale data. To use the user's preferences, you can use
Defaults standard User Defaults] dictionary Representation]
If you pass
nilor an instance of
NSDateuses the system default locale—this is not the same as the current user's locale.
NSDate object set to the date and time specified by
string as interpreted according to
This method supports only a limited set of colloquial phrases, primarily in English. It may give unexpected results, and its use is strongly discouraged. To create a date object from a string, you should use a date formatter object instead (see
NSDate and Data Formatting Guide).
The keys and values that represent the locale data from
locale are used when parsing the string. In addition to the locale keys listed in the class description, these keys are used when parsing natural language strings: