phellow/date
最新稳定版本:1.0.1
Composer 安装命令:
composer require phellow/date
包简介
Helps to work with dates
README 文档
README
This small library will help you to work with date/time specific objects.
Install via Composer
Add the following dependency to your project's composer.json file:
{
"require": {
"phellow/date": "1.*"
}
}
Usage
Use the DateFactory to create all objects. You can add the factory to your Dependency Injection Container.
$factory = new \Phellow\Date\DateFactory(); // create a DateTime object $dt = $factory->createDateTime(); $dt = $factory->createDateTime('now'); $dt = $factory->createDateTime('2014-12-8'); $dt = $factory->createDateTime(time()); $dt = $factory->createDateTime($dt); // create a Month object $month = $factory->createMonth(); $month = $factory->createMonth('now'); $month = $factory->createMonth('2014-12-8'); $month = $factory->createMonth(time()); $month = $factory->createMonth($dt);
To see all the possibilities, you can check out the Unit Tests under tests/.
License
The MIT license.
统计信息
- 总下载量: 34
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-12-07