Chronos v2.0.0 Release Notes
Release Date: 2019-11-30 // over 4 years ago-
💥 Breaking Changes
- PHP 7.2 required.
- 0️⃣
Date
andMutableDate
now use server default time zone instead of UTC. This makes using Date objects easier for time zones that are far away from UTC asDate::today()
will not be wrong as often. - ➕ Additional typehints added to methods.
addYears()
no longer overflows months. For example adding(new Chronos('2012-02-29'))->addYears(1);
Results in2013-02-28
not2013-03-01
.
🆕 New Features
- Strict mode enabled for all files in chronos.
- ➕ Add
Chronos\DifferenceFormatterInterface
. Chronos::copy()
returns a new instance now.- 0️⃣
Date
andMutableDate
constructor now allow time zones to be passed in. This allows you to take dates from other time zones. The default time zone is used if not specified. - 👍
ChronosInterval
now supports microseconds. - ➕ Added
addYearsWithOverflow()
to retain backwards compatibility with the previous behavior ofaddYears()
. - ➕ Added
createFromArray()
to ease creating instances from array data.