herrera-io/date-interval
最新稳定版本:1.2.0
Composer 安装命令:
composer require herrera-io/date-interval
包简介
Provides additional functionality to the DateInterval class.
关键字:
README 文档
README
Provides additional functionality to the DateInterval class.
Summary
The DateInterval class builds on the existing DateInterval class provided by PHP. With the new class, you may
- convert
DateIntervalto the interval spec - convert
DateIntervalto the number of seconds- convert back to
DateIntervalfrom the number of seconds
- convert back to
The conversion to seconds requires a bit of explaining.
Installation
Add it to your list of Composer dependencies:
$ composer require herrera-io/date-interval=1.*
Usage
<?php use Herrera\DateInterval\DateInterval; $interval = new DateInteval('P2H'); echo $interval->toSeconds(); // "7200" echo DateInterval::toSeconds($interval); // "7200" echo $interval->toSpec(); // "P2H" echo DateInterval::toSpec($interval); // "P2H"
统计信息
- 总下载量: 29.59k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 15
- 点击次数: 1
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2013-02-19