# What changed in date-and-time

> 20 changes in date-and-time 4 from its official release notes, upgrade guides and advisories: 1 breaking, 1 deprecations, 10 new APIs and options. Each one cited. Sources checked 2026-10-27. HTML: https://unstale.sh/npm/date-and-time/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## date-and-time 4

### Breaking changes

- defaultDate.Z takes precedence over the timeZone option when both are present. (4.5.0) — [release notes](https://github.com/knowledgecode/date-and-time/releases/tag/v4.5.0)

### Deprecations

- Class-based plugins are deprecated; plugin authors should consider the new object-literal plugin types. (4.6.0) — [release notes](https://github.com/knowledgecode/date-and-time/releases/tag/v4.6.0)

### New APIs and options

- Object-literal plugin types were added, giving plugin authors a new way to define plugins. (4.6.0) — [release notes](https://github.com/knowledgecode/date-and-time/releases/tag/v4.6.0)
- parse() and isValid() accept a ParsedComponents object to provide fallback values for date/time components missing from the format string. (4.5.0) — [release notes](https://github.com/knowledgecode/date-and-time/releases/tag/v4.5.0)
- A standalone, reusable interface is available in parser.ts; PreparseResult now extends it. (4.5.0) — [release notes](https://github.com/knowledgecode/date-and-time/releases/tag/v4.5.0)
- A new utility function is available in the public API. (4.4.0) — [release notes](https://github.com/knowledgecode/date-and-time/releases/tag/v4.4.0)
- A new plugin provides quarter-of-year functionality. (4.4.0) — [release notes](https://github.com/knowledgecode/date-and-time/releases/tag/v4.4.0)
- A new plugin supports Unix timestamp seconds and milliseconds. (4.4.0) — [release notes](https://github.com/knowledgecode/date-and-time/releases/tag/v4.4.0)
- A new plugin provides ISO 8601 week formatting. (4.4.0) — [release notes](https://github.com/knowledgecode/date-and-time/releases/tag/v4.4.0)
- All date manipulation functions now support IANA timezone strings. (4.3.0) — [release notes](https://github.com/knowledgecode/date-and-time/releases/tag/v4.3.0)
- A new entry point lets developers import multiple timezones from a single module. (4.2.0) — [release notes](https://github.com/knowledgecode/date-and-time/releases/tag/v4.2.0)
- The format() function accepts IANA timezone name strings in addition to TimeZone objects. (4.2.0) — [release notes](https://github.com/knowledgecode/date-and-time/releases/tag/v4.2.0)

### Tooling

- Type definitions were added, allowing developers to use the package with type information. (4.1.1) — [release notes](https://github.com/knowledgecode/date-and-time/releases/tag/v4.1.1)

### Fixes and other changes

- CJS type definitions were fixed. (4.7.0) — [release notes](https://github.com/knowledgecode/date-and-time/releases/tag/v4.7.0)
- Invalid-input handling was fixed. (4.7.0) — [release notes](https://github.com/knowledgecode/date-and-time/releases/tag/v4.7.0)
- CommonJS default-export interop was fixed. (4.6.0) — [release notes](https://github.com/knowledgecode/date-and-time/releases/tag/v4.6.0)
- Fixed a parsing bug involving defaultDate and 12-24-hour parsing. (4.5.2) — [release notes](https://github.com/knowledgecode/date-and-time/releases/tag/v4.5.2)
- isValid() validates defaultDate components, and leap-day validation respects a defaultDate.Y context. (4.5.0) — [release notes](https://github.com/knowledgecode/date-and-time/releases/tag/v4.5.0)
- Timezone name mappings were corrected for Falkland, Greenland, Hawaii-Aleutian, Macao, and 10+ additions. (4.4.0) — [release notes](https://github.com/knowledgecode/date-and-time/releases/tag/v4.4.0)
- Fixes timezone offset range and month boundary handling. (4.3.0) — [release notes](https://github.com/knowledgecode/date-and-time/releases/tag/v4.3.0)
