我正在寻找一个PHP 库,可以生成用户友好的时间表示,例如两小时前,当时间戳为 time() - 2 * 3600 。
I'm looking for a PHP library that generates user-friendly representations of times - for example "two hours ago" when the timestamp is time() - 2 * 3600.
有几个现有的问题与答案和博客文章(, 2 , 3 ) ,但都只包含代码段 - 不能是我可以安装和升级的库。
There are several existing questions with answers and blog posts (1, 2, 3), but all only contain code snippets - not a library I can install and upgrade.
Django有一个,Python也有一个独立lib ,Javascript有几个( 1 , 2 , 3 ),PHP库在哪里?
Django has one, Python also has a standalone lib, Javascript has several (1, 2, 3), too - where is the PHP library?
图书馆应该具备以下内容:
A library should have the following things:
- 文档
- PEAR可安装
- 定期发布
- (可选) li>
- documentation
- PEAR installable
- regular releases
- (optional) translations
由于似乎没有图书馆,我自己做了一个它包含在PEAR中:
Since there didn't seem to be any library, I've made one myself and got it included in PEAR:
Date_HumanDiff , pear.php/package/Date_HumanDiff
代码位于 github/pear/Date_HumanDiff
更多推荐
PHP库生成用户友好的相对时间戳
发布评论