---
title: "init(name:data:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/nstimezone/init(name:data:)"
---

# init(name:data:)

Initializes a time zone with a given identifier and time zone data.

## Declaration

```swift
init?(name tzName: String, data aData: Data?)
```

## Parameters

- `tzName`: The identifier for the time zone. Providing nil for this parameter raises an invalid argument exception.
- `aData`: This parameter is ignored.

## Discussion

Discussion As of macOS 10.6, the underlying implementation of this method has been changed to ignore the specified data parameter. important: You should not use this method. Instead, use init(name:) to initialize a time zone object with a given name.

## See Also

### Creating Time Zones

- [init(name:)](foundation/nstimezone/init(name:).md)
- [init(abbreviation:)](foundation/nstimezone/init(abbreviation:).md)
- [init(forSecondsFromGMT:)](foundation/nstimezone/init(forsecondsfromgmt:).md)
- [knownTimeZoneNames](foundation/nstimezone/knowntimezonenames.md)
- [abbreviationDictionary](foundation/nstimezone/abbreviationdictionary.md)
