You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update documentation for v4.3.0 IANA timezone string support
- Update type signatures from TimeZone | 'UTC' to TimeZone | string across
all API docs (addDays, addMonths, addYears, format, parse, subtract, etc.)
- Document IANA timezone string usage for all date manipulation functions
- Add v4.3.0 new features section to migration.md
- Promote Method 3 (IANA string) as the recommended approach in timezones.md
- Fix minor grammar and punctuation issues
|`H`| Hour in 24-hour format (no padding)| 23, 8 |
70
+
|`H`| Hour in 24-hour format without zero padding | 23, 8 |
71
71
|`hh`| Hour in 12-hour format | 11, 08 |
72
-
|`h`| Hour in 12-hour format (no padding)| 11, 8 |
72
+
|`h`| Hour in 12-hour format without zero padding | 11, 8 |
73
73
|`mm`| Minutes | 14, 07 |
74
74
|`m`| Minutes without zero padding | 14, 7 |
75
75
|`ss`| Seconds | 05, 10 |
@@ -140,10 +140,12 @@ For a complete list of all supported locales with import examples, see [Supporte
140
140
141
141
### timeZone
142
142
143
-
**Type**: `TimeZone | "UTC"`
143
+
**Type**: `TimeZone | string`
144
144
**Default**: `undefined` (local timezone)
145
145
146
-
Interprets the parsed date in the specified timezone. **Note**: If the input string contains a timezone offset (e.g., `Z` or `ZZ` tokens), that offset takes precedence and the `timeZone` option is ignored.
146
+
Interprets the parsed date in the specified timezone.
147
+
148
+
**Note**: If the input string contains a timezone offset (e.g., `Z` or `ZZ` tokens), that offset takes precedence and the `timeZone` option is ignored.
// => Fri Aug 23 2025 14:30:00 GMT+0500 (New_York timeZone is ignored)
171
177
```
172
178
173
-
:::warning Important Difference from format()
174
-
The `parse()`function only accepts TimeZone objectsand the "UTC" string for the `timeZone` option. Unlike `format()`, which supports both TimeZone objects and IANA timezone name strings, `parse()` does not support string type timezone names.
179
+
:::tip
180
+
Like `format()`, `parse()` accepts TimeZone objects, IANA timezone name strings (e.g., `'America/New_York'`), and the `"UTC"` string for the `timeZone` option. If the input string contains a timezone offset token (`Z` or `ZZ`), that offset takes precedence over the `timeZone` option.
175
181
:::
176
182
177
183
For a complete list of all supported timezones with import examples, see [Supported Timezones](../timezones).
@@ -370,12 +376,12 @@ parse('Jan 1 0000', 'MMM D YYYY');
370
376
371
377
### UTC Input Parsing
372
378
373
-
If the input string doesn't contain a timezone offset and no `timeZone` option is specified, the function treats the input as local timezone. To parse input as UTC, set `timeZone: 'UTC'` in the options.
379
+
If the input string doesn't contain a timezone offset and no `timeZone` option is specified, the function treats the input as the local timezone. To parse input as UTC, set `timeZone: 'UTC'` in the options.
0 commit comments