<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/ISO8601DateFormatter/string(from:timeZone:formatOptions:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSISO8601DateFormatter(cm)stringFromDate:timeZone:formatOptions:"
  },
  "title" : "string(from:timeZone:formatOptions:)"
}
-->

# string(from:timeZone:formatOptions:)

Creates a representation of the specified date with a given time zone and format options.

```
class func string(from date: Date, timeZone: TimeZone, formatOptions: ISO8601DateFormatter.Options = []) -> String
```

## Parameters

`date`

The date to be represented.

`timeZone`

The time zone used.

`formatOptions`

The options used. For possible values, see [`ISO8601DateFormatter.Options`](/documentation/Foundation/ISO8601DateFormatter/Options).

## Return Value

A user-readable string representing the date.

## Discussion

This method uses a date formatter configured with the specified time zone and format options. The following code examples produce the same string value:

```objc
NSDate *date = [NSDate date];
NSString *string;
 
NSISO8601DateFormatter *formatter = [[NSISO8601DateFormatter alloc] init];
string = [formatter stringFromDate:date];
 
NSTimeZone *GMT = [NSTimeZone timeZoneWithAbbreviation: @"GMT"];
NSISO8601DateFormatOptions options = NSISO8601DateFormatWithInternetDateTime | NSISO8601DateFormatWithDashSeparatorInDate | NSISO8601DateFormatWithColonSeparatorInTime | NSISO8601DateFormatWithTimeZone;
string = [NSISO8601DateFormatter stringFromDate:date timeZone:GMT formatOptions:options];
```

---

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)