---
title: "description(with:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsdate/description(with:)"
---

# description(with:)

Returns a string representation of the date using the given locale.

## Declaration

```swift
func description(with locale: Any?) -> String
```

## Parameters

- `locale`: An NSLocale object. If you pass nil, NSDate formats the date in the same way as the doc://com.apple.foundation/documentation/Foundation/NSDate/description property. In OS X v10.4 and earlier, this parameter was an NSDictionary object. If you pass in an NSDictionary object in OS X v10.5, NSDate uses the default user locale—the same as if you passed in [NSLocale currentLocale].

## Return Value

Return Value A string representation of the receiver, using the given locale, or if the locale argument is nil, in the international format YYYY-MM-DD HH:MM:SS ±HHMM, where ±HHMM represents the time zone offset in hours and minutes from UTC (for example, “2001-03-24 10:45:32 +0600”)

## Discussion

Discussion In OS X v10.4 and earlier, localeDictionary is an NSDictionary object containing locale data. To use the user’s preferences, you can use [[NSUserDefaults standardUserDefaults] dictionaryRepresentation].

## See Also

### Describing Dates

- [description](foundation/nsdate/description.md)
- [customPlaygroundQuickLook](foundation/nsdate/customplaygroundquicklook.md)
