PackageTrack
Sign in Get early access

brick/date-time

Date and time library

0.9.0 4.1M downloads/mo #1752 most downloaded on Packagist brick/date-time

What this package is like to depend on

Last release 7 months ago

03 Jan 2026

Ships unpredictably

gaps range from 9 days to 1.2 years

Nearly every release is documented

notes for 45 of 45 stable releases

Nothing withdrawn

no release was ever pulled

9 years old

45 releases · first in 2017

4 releases in the last 12 months

see the full history below

Release timeline

45 releases · Oct 2017 to Jan 2026
2018 2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 45
  1. 0.9.0 03 Jan 2026
    Release notes

    💥 Breaking changes

    • Minimum PHP version is now 8.2
    • The following classes are now final:
      • YearMonthRange
      • ZonedDateTime
      • Parser\DateTimeParseException
    Open source →
    Release notes

    💥 Breaking changes

    • Minimum PHP version is now 8.2
    • The following classes are now final:
      • YearMonthRange
      • ZonedDateTime
      • Parser\DateTimeParseException
    Open source →
    Release notes

    0.9.0 Latest

    Latest

    Compare

    Choose a tag to compare

    Open source →
  2. 0.8.1 11 Nov 2025
    Release notes

    Compatibility improvements

    • The following parser and parse methods now accept hours only in timezone offsets, such as +01 equivalent to +01:00 (#123 by @antonkomarev):
      • IsoParsers:timeZoneOffset()
      • TimeZoneOffset::parse()
      • ZonedDateTime::parse()
    Open source →
    Release notes

    Compatibility improvements

    • The following parser and parse methods now accept hours only in timezone offsets, such as +01 equivalent to +01:00 (#123 by @antonkomarev):
      • IsoParsers:timeZoneOffset()
      • TimeZoneOffset::parse()
      • ZonedDateTime::parse()
    Open source →
    Release notes

    0.8.1

    Compare

    Choose a tag to compare

    Open source →
  3. 0.8.0 10 Nov 2025
    Release notes

    💥 Breaking changes

    • Duration::toISOString() and __toString() now output negative durations as -P... (#122 by @BastienClement)
      Example: -PT2H21M instead of PT-2H-21M.
      This aligns with ISO 8601-2:2019 and improves compatibility with the JavaScript Temporal API.
    Open source →
    Release notes

    💥 Breaking changes

    • Duration::toISOString() and __toString() now output negative durations as -P... (#122 by @BastienClement)
      Example: -PT2H21M instead of PT-2H-21M.
      This aligns with ISO 8601-2:2019 and improves compatibility with the JavaScript Temporal API.
    Open source →
    Release notes

    0.8.0

    Compare

    Choose a tag to compare

    Open source →
  4. 0.7.1 29 Aug 2025
    Release notes

    🐛 Bug fixes

    • ZoneDateTime incorrectly handled DST Transitions with relative time addition (#115)

    New features

    • LocalDate::getQuarter() and getQuarterValue() return the quarter of the year (#114 by @pscheit)
    Open source →
    Release notes

    🐛 Bug fixes

    • ZoneDateTime incorrectly handled DST Transitions with relative time addition (#115)

    New features

    • LocalDate::getQuarter() and getQuarterValue() return the quarter of the year (#114 by @pscheit)
    Open source →
    Release notes

    0.7.1

    Compare

    Choose a tag to compare

    Open source →
  5. 0.7.0 23 Jun 2024
    Release notes

    💥 Breaking changes

    • DayOfWeek:
      • deprecated method of() has been removed, use DayOfWeek::from() instead
      • the following deprecated methods have been removed, use enum values instead:
        • DayOfWeek::monday()DayOfWeek::MONDAY
        • DayOfWeek::tuesday()DayOfWeek::TUESDAY
        • DayOfWeek::wednesday()DayOfWeek::WEDNESDAY
        • DayOfWeek::thursday()DayOfWeek::THURSDAY
        • DayOfWeek::friday()DayOfWeek::FRIDAY
        • DayOfWeek::saturday()DayOfWeek::SATURDAY
        • DayOfWeek::sunday()DayOfWeek::SUNDAY
      • deprecated method getValue() has been removed, use $dayOfWeek->value instead
      • deprecated method is() has been removed, compare values with $dayOfWeek or $dayOfWeek->value instead
      • deprecated method isEqualTo() has been removed, use strict equality === between DayOfWeek instances instead.
    • DefaultClock:
      • deprecated method travel() has been removed, use travelTo() instead
    • LocalDate:
      • deprecated method getDay() has been removed, use getDayOfMonth() instead
      • getMonth() now returns a Month enum; use getMonthValue() if you want the month number
    • LocalDateTime:
      • deprecated method getDay() has been removed, use getDayOfMonth() instead
      • getMonth() now returns a Month enum; use getMonthValue() if you want the month number
    • Month:
      • deprecated method of() has been removed, use Month::from() instead
      • deprecated method getAll() has been removed, use Month::cases() instead
      • deprecated method getValue() has been removed, use $month->value instead
      • deprecated method is() has been removed, compare values with $month or $month->value instead
      • deprecated method isEqualTo() has been removed, use strict equality === between Month instances instead
    • MonthDay:
      • deprecated method getDay() has been removed, use getDayOfMonth() instead
      • getMonth() now returns a Month enum; use getMonthValue() if you want the month number
    • YearMonth:
      • getMonth() now returns a Month enum; use getMonthValue() if you want the month number
    • ZonedDateTime:
      • deprecated method getDay() has been removed, use getDayOfMonth() instead
      • getMonth() now returns a Month enum; use getMonthValue() if you want the month number

    🔧 Improvements

    • Methods returning int are now type-annotated with int ranges
    Open source →
    Release notes

    💥 Breaking changes

    • DayOfWeek:
      • deprecated method of() has been removed, use DayOfWeek::from() instead
      • the following deprecated methods have been removed, use enum values instead:
        • DayOfWeek::monday()DayOfWeek::MONDAY
        • DayOfWeek::tuesday()DayOfWeek::TUESDAY
        • DayOfWeek::wednesday()DayOfWeek::WEDNESDAY
        • DayOfWeek::thursday()DayOfWeek::THURSDAY
        • DayOfWeek::friday()DayOfWeek::FRIDAY
        • DayOfWeek::saturday()DayOfWeek::SATURDAY
        • DayOfWeek::sunday()DayOfWeek::SUNDAY
      • deprecated method getValue() has been removed, use $dayOfWeek->value instead
      • deprecated method is() has been removed, compare values with $dayOfWeek or $dayOfWeek->value instead
      • deprecated method isEqualTo() has been removed, use strict equality === between DayOfWeek instances instead.
    • DefaultClock:
      • deprecated method travel() has been removed, use travelTo() instead
    • LocalDate:
      • deprecated method getDay() has been removed, use getDayOfMonth() instead
      • getMonth() now returns a Month enum; use getMonthValue() if you want the month number
    • LocalDateTime:
      • deprecated method getDay() has been removed, use getDayOfMonth() instead
      • getMonth() now returns a Month enum; use getMonthValue() if you want the month number
    • Month:
      • deprecated method of() has been removed, use Month::from() instead
      • deprecated method getAll() has been removed, use Month::cases() instead
      • deprecated method getValue() has been removed, use $month->value instead
      • deprecated method is() has been removed, compare values with $month or $month->value instead
      • deprecated method isEqualTo() has been removed, use strict equality === between Month instances instead
    • MonthDay:
      • deprecated method getDay() has been removed, use getDayOfMonth() instead
      • getMonth() now returns a Month enum; use getMonthValue() if you want the month number
    • YearMonth:
      • getMonth() now returns a Month enum; use getMonthValue() if you want the month number
    • ZonedDateTime:
      • deprecated method getDay() has been removed, use getDayOfMonth() instead
      • getMonth() now returns a Month enum; use getMonthValue() if you want the month number

    🔧 Improvements

    • Methods returning int are now type-annotated with int ranges
    Open source →
    Release notes

    0.7.0

    Compare

    Choose a tag to compare

    Open source →
  6. 0.6.5 19 Jun 2024
    Release notes

    New methods

    • LocalDate::previousDayOfWeek()
    • LocalDate::previousOrSameDayOfWeek()
    • LocalDate::nextDayOfWeek()
    • LocalDate::nextOrSameDayOfWeek()
    Open source →
    Release notes

    New methods

    • LocalDate::previousDayOfWeek()
    • LocalDate::previousOrSameDayOfWeek()
    • LocalDate::nextDayOfWeek()
    • LocalDate::nextOrSameDayOfWeek()
    Open source →
    Release notes

    0.6.5

    Compare

    Choose a tag to compare

    Open source →
  7. 0.6.4 24 Apr 2024
    Release notes

    New features

    • DefaultClock::travelBy() travels in time by a duration (#92)

    🗑️ Deprecations

    • DefaultClock::travel() is now deprecated in favour of travelTo() (#92)

    Thanks to @francislavoie!

    Open source →
    Release notes

    New features

    • DefaultClock::travelBy() travels in time by a duration (#92)

    💩 Deprecations

    • DefaultClock::travel() is now deprecated in favour of travelTo() (#92)

    Thanks to @francislavoie!

    Open source →
    Release notes

    0.6.4

    Compare

    Choose a tag to compare

    Open source →
  8. 0.6.3 02 Apr 2024
    Release notes

    New features

    • Stopwatch::stop() now returns the lap duration (#98)

    Thanks to @rodnaph!

    Open source →
    Release notes

    New features

    • Stopwatch::stop() now returns the lap duration (#98)

    Thanks to @rodnaph!

    Open source →
    Release notes

    0.6.3

    Compare

    Choose a tag to compare

    Open source →
  9. 0.6.2 01 Apr 2024
    Release notes

    New features

    • MonthDay::of() and MonthDay::withMonth() now accept a Month enum as parameter (#106)
    • LocalDate::of() and LocalDate::withMonth() now accept a Month enum as parameter (#106)
    • LocalDateTime::of() and LocalDateTime::withMonth() now accept a Month enum as parameter (#106)
    • ZonedDateTime::withMonth() now accepts a Month enum as parameter (#106)

    Undeprecations

    • Passing an int to Year::atMonth() is un-deprecated, and now valid again (#103)
    • Passing an int to YearMonth::of() and YearMonth::withMonth() is un-deprecated, and now valid again (#103)
    • Passing an int to YearWeek::atDay() is un-deprecated, and now valid again (#103)

    Thanks to @gnutix!

    Open source →
    Release notes

    New features

    • MonthDay::of() and MonthDay::withMonth() now accept a Month enum as parameter (#106)
    • LocalDate::of() and LocalDate::withMonth() now accept a Month enum as parameter (#106)
    • LocalDateTime::of() and LocalDateTime::withMonth() now accept a Month enum as parameter (#106)
    • ZonedDateTime::withMonth() now accepts a Month enum as parameter (#106)

    Undeprecations

    • Passing an int to Year::atMonth() is un-deprecated, and now valid again (#103)
    • Passing an int to YearMonth::of() and YearMonth::withMonth() is un-deprecated, and now valid again (#103)
    • Passing an int to YearWeek::atDay() is un-deprecated, and now valid again (#103)

    Thanks to @gnutix!

    Open source →
    Release notes

    0.6.2

    Compare

    Choose a tag to compare

    Open source →
  10. 0.6.1 26 Mar 2024
    Release notes

    New features

    • Year::atMonth() now accepts a Month enum as parameter (#95)
    • YearMonth::of() and YearMonth::withMonth() now accept a Month enum as parameter (#96)

    🔧 Improvements

    • Narrower Psalm types for compareTo(), __toString(), toISOString(), jsonSerialize() methods (#97)

    💩 Deprecations

    • Passing an int to Year::atMonth() is now deprecated, pass a Month enum instead (#95)
    • Passing an int to YearMonth::of() and YearMonth::withMonth() is now deprecated, pass a Month enum instead (#96)

    Thanks to @gnutix!

    Open source →
    Release notes

    New features

    • Year::atMonth() now accepts a Month enum as parameter (#95)
    • YearMonth::of() and YearMonth::withMonth() now accept a Month enum as parameter (#96)

    🔧 Improvements

    • Narrower Psalm types for compareTo(), __toString(), toISOString(), jsonSerialize() methods (#97)

    💩 Deprecations

    • Passing an int to Year::atMonth() is now deprecated, pass a Month enum instead (#95)
    • Passing an int to YearMonth::of() and YearMonth::withMonth() is now deprecated, pass a Month enum instead (#96)

    Thanks to @gnutix!

    Open source →
    Release notes

    0.6.1

    Compare

    Choose a tag to compare

    Open source →
  11. 0.6.0 05 Dec 2023
    Release notes

    💥 Breaking changes

    • Minimum PHP version is now 8.1
    • DayOfWeek:
      • DayOfWeek is now an enum: constants MONDAY, TUESDAY, etc. are now DayOfWeek instances, not integers
      • the __toString() method is removed, use toString() instead (enums disallow magic methods)
      • the all() method does not accept null anymore, and defaults to DayOfWeek::MONDAY
    • Month:
      • Monthis now an enum: constants JANUARY, FEBRUARY, etc. are now Month instances, not integers
      • the __toString() method is removed, use toString() instead (enums disallow magic methods)

    💩 Deprecations

    • DayOfWeek:
      • the of() method is deprecated, use DayOfWeek::from() instead
      • the following methods are deprecated, use enum values instead:
        • DayOfWeek::monday()DayOfWeek::MONDAY
        • DayOfWeek::tuesday()DayOfWeek::TUESDAY
        • DayOfWeek::wednesday()DayOfWeek::WEDNESDAY
        • DayOfWeek::thursday()DayOfWeek::THURSDAY
        • DayOfWeek::friday()DayOfWeek::FRIDAY
        • DayOfWeek::saturday()DayOfWeek::SATURDAY
        • DayOfWeek::sunday()DayOfWeek::SUNDAY
      • the getValue() method is deprecated, use $dayOfWeek->value instead
      • the is() method is deprecated, compare values with $dayOfWeek->value instead
      • the isEqualTo() method is deprecated, use strict equality === between DayOfWeek instances instead.
    • LocalDate:
      • getDay() is deprecated, use getDayOfMonth() instead
      • getMonth() is deprecated, use getMonthValue() instead (getMonth() will be repurposed to return a Month instance in a future release)
    • LocalDateTime:
      • getDay() is deprecated, use getDayOfMonth() instead
      • getMonth() is deprecated, use getMonthValue() instead (getMonth() will be repurposed to return a Month instance in a future release)
    • Month:
      • the of() method is deprecated, use Month::from() instead
      • the getAll() method is deprecated, use Month::cases() instead
      • the getValue() method is deprecated, use $month->value instead
      • the is() method is deprecated, compare values with $month->value instead
      • the isEqualTo() method is deprecated, use strict equality === between Month instances instead
    • MonthDay:
      • getDay() is deprecated, use getDayOfMonth() instead
      • getMonth() is deprecated, use getMonthValue() instead (getMonth() will be repurposed to return a Month instance in a future release)
    • YearMonth:
      • getMonth() is deprecated, use getMonthValue() instead (getMonth() will be repurposed to return a Month instance in a future release)
    • YearWeek:
      • the atDay() method now accepts a DayOfWeek instance, passing an integer is deprecated
    • ZonedDateTime:
      • getDay() is deprecated, use getDayOfMonth() instead
      • getMonth() is deprecated, use getMonthValue() instead (getMonth() will be repurposed to return a Month instance in a future release)
    Open source →
  12. 0.5.5 20 Oct 2023
    Release notes

    🐛 Bug fixes

    • Year::toISOString() / __toString() did not respect ISO 8601; years with less than 4 digits are now left-padded with zeros (#90)

    Thanks to @andreaswolf!

    Open source →
  13. 0.5.4 16 Oct 2023
    Release notes

    🐛 Bug fixes

    • YearMonth::__toString() would return an invalid string for years < 1000 (#87)

    New methods

    • Year::parse() and Year::from() (#86)
    • YearWeek::parse() and YearWeek::from() (#86)
    • the following classes now have a toISOString() method: (#87)
      • Duration
      • Instant
      • Interval
      • LocalDate
      • LocalDateRange
      • LocalDateTime
      • LocalTime
      • MonthDay
      • Period
      • Year
      • YearMonth
      • YearMonthRange
      • YearWeek
      • ZonedDateTime

    The toISOString() methods return the same result as __toString(), but are better suited for the nullsafe operator:

    $date?->toISOString();
    

    ⚡️ Performance optimizations

    • Most __toString() methods got a small performance boost (#85)

    Thanks to @gnutix!

    Open source →
  14. 0.5.3 26 Sep 2023
    Release notes

    New methods

    • Instant::getIntervalTo() (#81)
    • ZonedDateTime::getIntervalTo() (#81)

    Thanks to @solodkiy!

    Open source →
  15. 0.5.2 16 Sep 2023
    Release notes

    ⚡️ Performance optimizations

    • These methods got a small performance boost: Local(Date|Time|DateTime) minOf()/maxOf() (#76)
    • Static objects returned by factory methods are now cached (#77)
    • The special case LocalDate::plusDays(1) is now much faster (#79)

    Thanks to @gnutix and @BastienClement!

    Open source →
  16. 0.5.1 01 Aug 2023
    Release notes

    New methods

    Open source →
  17. 0.5.0 25 Jun 2023
    Release notes

    💥 Breaking changes

    • Deprecated Interval constructor is now private; please use Interval::of() instead

    • The following deprecated methods have been removed, please use the new names:

      Class Name Old Method Name New Method Name
      LocalDate fromDateTime() fromNativeDateTime()
      LocalDate toDateTime() toNativeDateTime()
      LocalDate toDateTimeImmutable() toNativeDateTimeImmutable()
      LocalDateRange toDatePeriod() toNativeDatePeriod()
      LocalDateTime fromDateTime() fromNativeDateTime()
      LocalDateTime toDateTime() toNativeDateTime()
      LocalDateTime toDateTimeImmutable() toNativeDateTimeImmutable()
      LocalTime fromDateTime() fromNativeDateTime()
      LocalTime toDateTime() toNativeDateTime()
      LocalTime toDateTimeImmutable() toNativeDateTimeImmutable()
      Period fromDateInterval() fromNativeDateInterval()
      Period toDateInterval() toNativeDateInterval()
      TimeZone fromDateTimeZone() fromNativeDateTimeZone()
      TimeZone toDateTimeZone() toNativeDateTimeZone()
      ZonedDateTime fromDateTime() fromNativeDateTime()
      ZonedDateTime toDateTime() toNativeDateTime()
      ZonedDateTime toDateTimeImmutable() toNativeDateTimeImmutable()
    Open source →
  18. 0.4.3 20 Jun 2023
    Release notes

    🔧 Improvements

    • TimeZoneOffset::parse() return type has been narrowed to TimeZoneOffset
    • Support for seconds in TimeZoneOffset has been added back (#60) (@jiripudil)

    🐛 Bug fixes

    • Old date/times could fail to be parsed by ZonedDateTime due to sub-minute timezone offsets (#44)
    Open source →
  19. 0.4.2 19 May 2023
    Release notes

    New methods

    • Duration::isGreaterThanOrEqualTo() (#50)
    • Duration::isLessThanOrEqualTo() (#50)
    • Interval::of() (#64)
    • Interval::contains() (#64)
    • Interval::intersectsWith() (#64)
    • Interval::getIntersectionWith() (#64)
    • Interval::isEqualTo() (#64)

    💩 Deprecations

    • Interval constructor is deprecated in favour of Interval::of() (#64)
    Open source →
  20. 0.4.1 18 Jun 2022
    Release notes

    New methods

    • LocalDateRange::toPeriod() (#51)
    • Year::toLocalDateRange() (#46)
    • YearMonth::toLocalDateRange() (#46)
    • YearMonthRange::toLocalDateRange() (#46)
    • YearWeek::toLocalDateRange() (#46)

    💩 Deprecations

    The following methods have been deprecated in favour of new names (#47):

    • Period::fromDateInterval()fromNativeDateInterval()
    • Period::toDateInterval()toNativeDateInterval()
    • TimeZone::fromDateTimeZone()fromNativeDateTimeZone()
    • TimeZone::toDateTimeZone()toNativeDateTimeZone()
    • LocalTime::fromDateTime()fromNativeDateTime()
    • LocalTime::toDateTime()toNativeDateTime()
    • LocalTime::toDateTimeImmutable()toNativeDateTimeImmutable()
    • LocalDateRange::toDatePeriod()toNativeDatePeriod()
    • LocalDate::fromDateTime()fromNativeDateTime()
    • LocalDate::toDateTime()toNativeDateTime()
    • LocalDate::toDateTimeImmutable()toNativeDateTimeImmutable()
    • ZonedDateTime::fromDateTime()fromNativeDateTime()
    • ZonedDateTime::toDateTime()toNativeDateTime()
    • ZonedDateTime::toDateTimeImmutable()toNativeDateTimeImmutable()
    • LocalDateTime::fromDateTime()fromNativeDateTime()
    • LocalDateTime::toDateTime()toNativeDateTime()
    • LocalDateTime::toDateTimeImmutable()toNativeDateTimeImmutable()
    Open source →
  21. 0.4.0 23 Dec 2021
    Release notes

    💥 Breaking changes

    • Minimum PHP version is now 7.4
    • TimeZoneOffset does not allow seconds anymore (#35):
      • TimeZoneOffset::of()'s $seconds parameter is removed
      • TimeZoneOffset::ofTotalSeconds() now throws if the number of seconds is not a multiple of 60
      • IsoParsers::timeZoneOffset() does not allow seconds in timezone offset anymore; this affects not only TimeZoneOffset:parse() but also ZonedDateTime::parse()

    🔧 Fix

    • Fixed return type of TimeZoneRegion::parse() (#38) Thanks to @adrianguenter

    New methods

    • Period::fromDateInterval() converts a native DateInterval object to Period
    Open source →
  22. 0.3.2 30 Jun 2021
    Release notes

    New methods

    • DayOfWeek::isWeekday()
    • DayOfWeek::isWeekend()
    • LocalDate::plusWeekdays()
    • LocalDate::minusWeekDays()
    Open source →
  23. 0.3.1 29 Jun 2021
    Release notes

    New methods

    • LocalDateRange::withStart()
    • LocalDateRange::withEnd()
    Open source →
  24. 0.3.0 15 Apr 2021
    Release notes

    💥 Breaking changes

    • The following methods now have return types:
      • Brick\DateTime\DayOfWeek::monday() through sunday()
      • Brick\DateTime\DayOfWeek::__toString()
      • Brick\DateTime\Month::__toString()
    Open source →
  25. 0.2.3 26 Feb 2021
    Release notes

    New method

    • LocalDateRange::toDatePeriod() (#31) Thanks to @morrislaptop

    🔧 Fix

    • Added missing ext-json requirement in composer.json
    Open source →
  26. 0.2.2 30 Jul 2020
    Release notes

    🐛 Bug fix

    LocalDateTime::plusDuration() and LocalDateTime::minusDuration() could return the wrong day. (#25)

    Thanks @JodyLognoul!

    Open source →
  27. 0.2.1 06 Apr 2020
    Release notes

    New methods

    • LocalDateRange::intersectsWith()
    • LocalDateRange::getIntersectionWith()

    Thanks @solodkiy!

    Open source →
  28. 0.2.0 08 Jan 2020
    Release notes

    💥 Breaking changes

    • most of the project classes are now final (#8)
    • the following deprecated methods have been removed:
      • LocalDateRange::getStartDate() - use getStart() instead (#13)
      • LocalDateRange::getEndDate() - use getEnd() instead (#13)
      • Duration::ofMilliseconds() - use ofMillis() instead
    Open source →
  29. 0.1.16 08 Jan 2020
    Release notes

    New methods

    • LocalDateRange::getStart() - deprecates getStartDate()
    • LocalDateRange::getEnd() - deprecates getEndDate()

    💩 Deprecations

    • LocalDateRange::getStartDate() is now deprecated and will be removed in 0.2.0.
    • LocalDateRange::getEndDate() is now deprecated and will be removed in 0.2.0.

    This makes LocalDateRange consistent with YearMonthRange.

    Open source →
  30. 0.1.15 07 Jan 2020
    Release notes

    🛠 Improvement

    The following classes now implement JsonSerializable (#19):

    • DayOfWeek
    • Duration
    • Instant
    • Interval
    • LocalDate
    • LocalDateRange
    • LocalDateTime
    • LocalTime
    • Month
    • MonthDay
    • Period
    • Year
    • YearMonth
    • YearMonthRange
    • YearWeek
    • ZonedDateTime

    Thanks to @kagmole!

    Open source →
  31. 0.1.14 17 Sep 2019
    Release notes

    New methods

    • Duration::toDays()
    • Duration::toDaysPart()
    • Duration::toHours()
    • Duration::toHoursPart()
    • Duration::toMinutes()
    • Duration::toMinutesPart()
    • Duration::toSeconds()
    • Duration::toSecondsPart()
    • Duration::toMillis()
    • Duration::toMillisPart()
    • Duration::toNanos()
    • Duration::toNanosPart()
    • Duration::ofNanos()

    See #15 for more information.

    💩 Deprecations

    • Duration::ofMilliseconds() is now ofMillis(); ofMilliseconds() is now deprecated and will be removed in 0.2.0.
    Open source →
  32. 0.1.13 17 Apr 2019
    Release notes

    New methods

    • LocalDateTime::isFuture()
    • LocalDateTime::isPast()

    These methods return whether a local date-time is in the future or in the past, in a given time-zone.

    Open source →
  33. 0.1.12 15 Apr 2019
    Release notes

    New methods

    • Instant::withEpochSecond() returns a copy of the Instant with the epoch second altered
    • Instant::withNano() returns a copy of the Instant with the nano-of-second altered
    Open source →
  34. 0.1.11 08 Mar 2019
    Release notes

    New class: YearMonthRange.

    Open source →
  35. 0.1.10 08 Mar 2019
    Release notes

    LocalDateRange::getIterator() is now type-hinted as LocalDate[] to allow static code analysis in IDEs.

    Open source →
  36. 0.1.9 14 Nov 2018
    Release notes

    New method: LocalDate::daysUntil()

    This allows to get the number of days between two dates.

    Open source →
  37. 0.1.8 29 Oct 2018
    Release notes

    New methods to convert objects to native DateTimeImmutable objects:

    • LocalDate::toDateTimeImmutable()
    • LocalTime::toDateTimeImmutable()
    • LocalDateTime::toDateTimeImmutable()
    • ZonedDateTime::toDateTimeImmutable()
    Open source →
  38. 0.1.7 18 Oct 2018
    Release notes

    New methods to convert to native DateTime objects:

    • LocalDate::toDateTime()
    • LocalTime::toDateTime()
    • LocalDateTime::toDateTime()

    This makes these methods in line with their fromDateTime() counterparts.

    Note: even though these classes represent partial date-time concepts, PHP merges all these concepts into a single DateTime class, so it is relevant to be able to easily export them as native PHP date-times, with sensible defaults.

    Open source →
  39. 0.1.6 18 Oct 2018
    Release notes

    New method:

    ZonedDateTime::toDateTime() : converts the ZonedDateTime to a native DateTime object.

    Open source →
  40. 0.1.5 13 Oct 2018
    Release notes

    New factory method:

    • Duration::ofMilliseconds()
    Open source →
  41. 0.1.4 14 Mar 2018
    Release notes

    New methods available to create objects from native DateTime or DateTimeImmutable objects:

    • LocalDate::fromDateTime()
    • LocalTime::fromDateTime()
    • LocalDateTime::fromDateTime()
    • ZonedDateTime::fromDateTime()
    Open source →
  42. 0.1.3 06 Feb 2018
    Release notes

    This release adds support for YearWeek.

    Open source →
  43. 0.1.2 04 Oct 2017
    Release notes

    Bug fix:

    • Duration::multipliedBy() could return an invalid Duration with negative nanos

    New methods:

    • Instant::toDecimal() returns a decimal timestamp such as 123456789.123456
    • FixedClock::move() allows to move the clock by a number of seconds and/or nanos

    New clock implementation:

    • ScaleClock makes the time move at a given pace

    New feature:

    • Methods such as now() now use the clock returned by DefaultClock. By default, this clock is still SystemClock, but it can now be overridden in tests. DefaultClock offers the freeze(), travel() and scale() methods inspired by timecop.
    Open source →
  44. 0.1.1 04 Oct 2017
    Release notes

    ZonedDateTime::isPast() and isFuture() now accept an optional Clock parameter.

    Open source →
  45. 0.1.0 04 Oct 2017
    Release notes

    First beta release.

    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive