warmans/date-range
Composer 安装命令:
composer require warmans/date-range
包简介
Small utility class used to create date range arrays.
README 文档
README
Relative
Thin wrapper around DateTime classes to simplify generating date ranges relative to the current date.
Basic Usage
Create a range instance specifying its options:
$range = new \DateRange\Relative(array('length'=>'60 DAY', 'interval'=>'P1D');
Export the specified range as an array:
var_dump($range->getRange());
It will look something like this:
array(
'01-01-2014' => array('raw' => \DateTime, 'formatted' => '01-01-2014')
'02-01-2014' => array('raw' => \DateTime, 'formatted' => '02-01-2014')
//etc...
)
Options
| Option | Example | Description |
|---|---|---|
| length | 30 DAYS | DateTime format relative date string |
| modify | -1 DAY | Offset the date range by this DateTime format relative date string |
| interval | P1D | DateInterval format interval |
| date_format | Y-m-d | date() style date format for result |
统计信息
- 总下载量: 3.55k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2014-09-02