<!--
{
  "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/description(withCalendarFormat:timeZone:locale:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSDate(im)descriptionWithCalendarFormat:timeZone:locale:"
  },
  "title" : "description(withCalendarFormat:timeZone:locale:)"
}
-->

# description(withCalendarFormat:timeZone:locale:)

Returns a string representation of the date formatted as specified by given conversion specifiers.

```
func description(withCalendarFormat format: String?, timeZone aTimeZone: TimeZone?, locale: Any?) -> String?
```

## Parameters

`format`

The format for the returned string (see Date and Number Formatters in OS X v10.0 to 10.3 for a discussion of how to create the format string). Pass `nil` to use the default format string, “`%Y-%m-%d %H:%M:%S %z`” (this conforms to the international format `YYYY-MM-DD HH:MM:SS ±HHMM`.)

`aTimeZone`

The time zone in which to represent the receiver. Pass `nil` to use the default time zone—specific to the current locale.

`locale`

An `NSDictionary` object containing locale data. To use the user’s preferences, you can use `[[NSUserDefaults standardUserDefaults] dictionaryRepresentation]`.

    If you pass     `nil`     or an instance of     `NSLocale`    ,     `NSDate`     uses the system default locale—this is not the same as the current user’s locale.

## Return Value

A string representation of the receiver, formatted as specified by the given conversion specifiers.

## Discussion

There are several problems with the implementation of this method that cannot be fixed for compatibility reasons. To format a date, 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)).

You could use this method to print the current time as follows:

```objc
sprintf(aString, "The current time is %s\n", [[[NSDate  date]
    descriptionWithCalendarFormat:@"%H:%M:%S %Z" timeZone:nil
    locale:[[NSUserDefaults standardUserDefaults] dictionaryRepresentation]]
        UTF8String]);
```

## See Also

[`description(with:)`](/documentation/Foundation/NSDate/description(with:))

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



---

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)