Download the PHP package frostealth/kronika without Composer
On this page you can find all versions of the php package frostealth/kronika. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download frostealth/kronika
More information about frostealth/kronika
Files in frostealth/kronika
Package kronika
Short Description DateTime value objects such as Date, Time, LocalDateTime, etc.
License MIT
Homepage https://github.com/frostealth/kronika
Informations about the package kronika
Kronika
Kronika is a PHP library that provides date-time value objects such as "Date", "Time", "LocalDateTime", "ZonedDateTime", etc.
Installation
The recommended way to install Kronika is through Composer.
Version Guidance
| Version | Status | Branch | PHP Version |
|---|---|---|---|
| 0.4 | Dev | 0.x | ^8.4 |
| 0.3 | Latest | - | ^8.4 |
| 0.1 | EOL | 0.1 | >=8.3,<=8.5 |
Usage
- Date
- Time
- LocalDateTime
- ZonedDateTime
- Clock
- Range:
- TimeRange
- DateRange
- DateTimeRange
- Extensions:
- Doctrine
- JMS Serializer
- Laravel
- Symfony Serializer
- Yii2
Date
Kronika\Date represents a date without specifying a time of day.
The following units of date are available:
YearMonthDayOfMonthDayOfWeekDayOfYear
Time
Kronika\Time represents a time of day without specifying a date.
The following units of time are available:
HourMinuteSecond
LocalDateTime
Kronika\LocalDateTime represents a local date-time without time-zone.
ZonedDateTime
Kronika\ZonedDateTime represents a date-time with time-zone.
The API of Kronika\ZonedDateTime is similar to Kronika\LocalDateTime.
Kronika\ZonedDateTime class extends \DateTimeImmutable.
Clock
Kronika\Clock decouples your code from the system clock
and has the following implementations:
SystemClockreturns the current time, this is the same as doingnew \DateTime().InaccurateClockignores a second or microsecond of the current time.PsrClockimplements PSR-20: Clock.FrozenClockdoesn't move forward on its own, useful in tests.MutableClockallows to manipulate with clock, useful in tests.
TimeRange
Kronika\Range\TimeRange represents a range between two moments of day.
DateRange
Kronika\Range\DateRange represents a range between two dates.
DateTimeRange
Kronika\Range\LocalDateTimeRangerepresents a range between two instances ofLocalDateTime.Kronika\Range\ZonedDateTimeRangerepresents a range between two instances ofZonedDateTime.