Chronos v2.0.0 Release Notes

Release Date: 2019-11-30 // over 4 years ago
  • 💥 Breaking Changes

    • PHP 7.2 required.
    • 0️⃣ Date and MutableDate now use server default time zone instead of UTC. This makes using Date objects easier for time zones that are far away from UTC as Date::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 in 2013-02-28 not 2013-03-01.

    🆕 New Features

    • Strict mode enabled for all files in chronos.
    • ➕ Add Chronos\DifferenceFormatterInterface.
    • Chronos::copy() returns a new instance now.
    • 0️⃣ Date and MutableDate 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 of addYears().
    • ➕ Added createFromArray() to ease creating instances from array data.