sunfoxcz/date-utils
最新稳定版本:v3.0.0
Composer 安装命令:
composer require sunfoxcz/date-utils
包简介
Library for easier working with date intervals.
关键字:
README 文档
README
Library for easier working with date intervals.
Installation
composer require sunfoxcz/date-utils
Usage
DateIntervalFactory
<?php declare(strict_types=1); use Sunfox\DateUtils\DateTime; use Sunfox\DateUtils\DateIntervalFactory; $start = new DateTime('2015-01-01'); $end = new DateTime('2015-12-31'); $months = DateIntervalFactory::create($start, $end, DateIntervalFactory::MONTH, 1, [ 'incomes' => [], 'expenses' => [], ]); foreach ($months as $k => $month) { echo "{$k}: " . $month->date->format('Y-m-d') . PHP_EOL; }
SpentTime
<?php declare(strict_types=1); use Sunfox\DateUtils\SpentTime; $spentTime = new SpentTime('1h30m'); echo (string) $spentTime; // 01:30:00 echo $spentTime->getTotalHours(); // 1,5 echo $spentTime->getTotalMinutes(); // 90 echo $spentTime->getTotalSeconds(); // 5400
For more usages Look into tests directory.
统计信息
- 总下载量: 4.6k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-07-29