composer namespace: simplecomplex/time
extends native \DateTime to fix shortcomings and defects, and provide more properties, getters and setters.
- enhanced timezone awareness
- diff which works correctly with non-UTC timezones
- safer formatting and modifying
- is stringable (sic!), to ISO-8601
- JSON serializes to string ISO-8601 with timezone marker
- freezable
- directly accessible time part properties
- more, simpler and safer getters and setters
has the same properties as native \DateInterval
plus signed relatives and totals, and works with non-UTC timezones.
returns interval with actual differences.
returns an interval which ignores daylight saving time shift.
In everyday business you often don't want the difference between a date outside daylight saving time (DST)
and a date inside DST to be off by the DST offset.
That offset can be particularly nasty if either of the dates is at or close to midnight,
because then the days difference may get 1 off.
It's main feature is to check overlap vs. another TimeSpan.
Is an immutable extending Time, not \DateTimeImmutable
.
Forces instances to be in local (default) timezone.
- PHP >=7.2 (64-bit)
- PHPUnit ^8 || ^9
- Jasny PHPUnit extension ^0.2