rbroen/datetime-practical
Composer 安装命令:
composer require rbroen/datetime-practical
包简介
A practical way at looking at datetime events
关键字:
README 文档
README
This library provides a useful object with a start moment and an end moment.
When using start and end in a full day mode, the start and end time should be 00:00:00, with the end date on the day AFTER the last full day. When displaying and/or editing as a full days, the code should present the last full day without the time.
Install
To install with composer:
composer require rbroen/datetime-practical
Requires PHP 8.2 or newer.
Usage
Here's a basic usage example:
<?php require '/path/to/vendor/autoload.php'; $start = new DateTimeImmutable(); // This creates an event starting now and lasting 4 days and 4 hours. $event = new \DateTimePractical\DateEvent($start, 'P4DT4H'); // This is an example with full days $start = (new DateTimeImmutable())->modify('midnight'); $event = new \DateTimePractical\DateEvent($start, 'P4D', true); $displayStr = (string) $event;
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2026-05-06