# Changelog
## 0.2.1
The API is a superset of 0.2.0. Several answers change to match PHP; check them before upgrading.
### Changed behaviour
- `U`, `B` and `timestamp()` round instants before 1970 down: half a second before the epoch is `-1`, not `0`.
- `timestamp()` is exact up to the year 9999 and from -9999 instead of stopping at the limits of jiff's `Timestamp`.
- Named zones, `from_utc` and `U` parsing work up to `9999-12-31 23:59:59`, which was an error.
- `parse_at`: a value that sets any date or time field has zero microseconds unless it gives them (`d/m/Y` used to copy
those of `now`).
- `*` takes at least one character and stops at a tab, not at parentheses.
- `+` consumes nothing and fails by itself nowhere; data left at the end is still an error.
- A value that ends before the pattern only allows `!`, `|` and `+` to remain: a final space or `*` is an error.
- `!` keeps a zone given as an offset or abbreviation, and a day name; it still drops an identifier.
- `a` / `A`: `p.m` and `P.M` without the final dot are errors.
- `D` / `l`: `Tues`, `Thur` and `Thurs` are errors; plural day names are read.
- `F` / `M` read Roman numerals. `U` takes a `+` sign. Zones may be preceded by spaces and parentheses, as `(CET)`.
- `Zone::parse` takes `+H:` and `+HH:`, and rejects `UTC+2`, lower-case `gmt+2`, `posixrules`, `localtime`,
`Etc/Unknown` and `posix/`, `right/` and `SystemV/` names.
- `From<TimeZone>` and `From<ZonedDateTime>` keep a jiff zone without a name as `Zone::Named` with its rules, instead of
the offset it had at the epoch; `e` prints its offset.
- `y`, `c` and `r` print years before Christ as PHP does (`-98`, `-005`).
- `to_dayjs` (and so `frontend_config`) rejects tokens Day.js would read as others when written together: `nm`, `mn`,
`wD`, `jj`, `GH`...
### Added
- `PhpDatePattern::format_into` and `formatted`, to write into a buffer or another string.
- `PhpDateTime::new_with` and `PhpDatePattern::parse_at_with`, to choose the first or second of a repeated hour, or
reject skipped and repeated ones.
- `PhpDatePattern::as_str`, `is_parseable`, `Display` and `FromStr`.
- `PhpDateTime::abbreviation`, `Kind::default_pattern`, `Kind::cast_fallback` and `DateConfig::unknown_keys`.
- `php_dates::jiff` re-export and the `tzdb-bundle` feature.
### Other
- Fewer allocations when formatting and in the strict parse.
- The minimum Rust version is 1.85 (was 1.99).
- The published package no longer carries the tests and their fixtures.
- CI workflow, property tests, fuzz targets, benchmarks, a second PHP fixture and a differential script.
- Tests that compiled patterns are `Send + Sync` and answer the same when shared between threads.
- The README says which zone names need `tzdata-legacy` on Debian and Ubuntu, and CI installs it.
- The documentation of the repeated hour said it matched PHP; it does not when the clocks go back to UTC+0 or ahead of
it (`Europe/London`, `Europe/Madrid`) and the value names no zone.
## 0.2.0
- Every token of PHP 8.5's `DateTime::format()` formats: `D l N S w z W F M t L o X x B v u e I O P p T Z c r U` join the
ones of 0.1.
- `PhpDatePattern::parse_at` and `parse_now` read like `DateTime::createFromFormat()`, with `!`, `|`, `?`, `*`, `#`,
zones, time stamps, day and month names and the fields filled from a given "now".
- `PhpDateTime` and `Zone` carry the time zone, as an identifier, an abbreviation or an offset.
- `compile` accepts letters that are not tokens, as PHP does. Use `compile_strict` for the previous behaviour.
- `to_dayjs` also translates `D l M F w v O P U`.
- Dates are `jiff` types instead of `chrono`, matching Laravel for Rust. `PhpDatePattern::parse` returns a
`jiff::civil::DateTime`.
- Tested against PHP 8.5.0 with generated fixtures.
## 0.1.0
First release: `d j m n Y y H G h g i s a A`, strict parsing and the Day.js export.