<!--
{
  "availability" : [
    "iOS: 2.0.0 - 8.0.0",
    "iPadOS: 2.0.0 - 8.0.0",
    "macCatalyst: 13.1.0 - 13.1.0",
    "macOS: 10.4.0 - 10.10.0"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSDate/date(withNaturalLanguageString:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSDate(cm)dateWithNaturalLanguageString:"
  },
  "title" : "date(withNaturalLanguageString:)"
}
-->

# date(withNaturalLanguageString:)

Creates and returns a date object set to the date and time specified by a given string.

```
class func date(withNaturalLanguageString string: String) -> Any?
```

## Parameters

`string`

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.”

## Return Value

A new `NSDate` object set to the current date and time specified by `string`.

## Discussion

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 [`DateFormatter`](/documentation/Foundation/DateFormatter) and [Data Formatting Guide](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/DataFormatting/DataFormatting.html#//apple_ref/doc/uid/10000029i)).

In parsing the string, this method uses the date and time preferences stored in the user’s defaults database. (See [`date(withNaturalLanguageString:locale:)`](/documentation/Foundation/NSDate/date(withNaturalLanguageString:locale:)) for a list of the specific items used.)

---

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)