litipk/php-jiffy
最新稳定版本:1.4.0
Composer 安装命令:
composer require litipk/php-jiffy
包简介
A library to handle precise timestamps the easy way.
关键字:
README 文档
README
Installation
composer require litipk/php-jiffy
Usage
The PHP Jiffy library provides the UniversalTimestamp class, which allows you to record timestamps with milliseconds
and microseconds precision and to convert it to other "timestamp types" whenever you need to do it.
The supported PHP versions are 5.5, 5.6, 7.0 and HHVM.
<?php use Litipk\Jiffy\UniversalTimestamp; $now = UniversalTimestamp::now(); $fromDateTime = UniversalTimestamp::fromDateTimeInterface(new \DateTime()); $fromMongoDate = UniversalTimestamp::fromMongoDate(new \MongoDate());
Notice: The MongoDB related methods are only available when the mongo or mongodb extensions are loaded.
Integration with Doctrine
If you want to use Jiffy's UniversalTimesamp objects in your Doctrine models, you can use our adapter layers:
- Jiffy Universal Timestamps for MongoDB ODM
- Jiffy Universal Timestamps for Doctrine ORM : Work in progress.
统计信息
- 总下载量: 35.02k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-10-26