Download the PHP package simplecomplex/time without Composer
On this page you can find all versions of the php package simplecomplex/time. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download simplecomplex/time
More information about simplecomplex/time
Files in simplecomplex/time
Package time
Short Description Time extends native DateTime class to fix shortcomings and defects, and provide more, simpler and safer getters and setters
License MIT
Homepage https://github.com/simplecomplex/php-time
Informations about the package time
(PHP) Time
composer namespace: simplecomplex/time
- Requirements
- License
Time
extends native \DateTime to fix shortcomings and defects, and provide more properties, getters and setters.
Features
- 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
Related classes
TimeInterval
has the same properties as native \DateInterval plus signed relatives and totals, and works with non-UTC timezones.
Time::diffTime()
returns interval with actual differences.
Time::diffDstIgnorant()
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.
TimeSpan
It's main feature is to check overlap vs. another TimeSpan.
TimeImmutable
Is an immutable extending Time, not \DateTimeImmutable.
TimeLocal
Forces instances to be in local (default) timezone.
Requirements
- PHP >=7.2 (64-bit)
Development requirements
- PHPUnit ^8 || ^9
- Jasny PHPUnit extension ^0.2
Suggestions
MIT licensed
All versions of time with dependencies
ext-ctype Version *