francerz / datetime-tools
Date Time Tools for PHP
Installs: 92
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/francerz/datetime-tools
Requires (Dev)
- phpunit/phpunit: ^9.6
This package is auto-updated.
Last update: 2025-09-21 01:33:56 UTC
README
A set of PHP functions to handle date and time units.
Class DateTimeHelper
class DateTimeHelper { public static function toDateTime($datetime): ?DateTime; public static function toDateTimeImmutable($datetime): ?DateTimeImmutable; public static function max($datetimes): ?DateTime; public static function min($datetimes): ?DateTime; }
class DateIntervalHelper { public static function create($y = 0, $m = 0, $d = 0, $h = 0, $i = 0, $s = 0); }
Class DateTimeRange
class DateTimeRange { public function __construct($start, $end); public function getStart(): ?DateTime; public function getEnd(): ?DateTime; public function intersect($datetime): bool; public function intersectRange(DateTimeRange $range, bool $withoutLimit = false): bool; public function getRangeIntersect(DateTimeRange $range): DateTimeRange|null; public function countSeconds(): int; public function countWeekDays(): int[]; }