cnp/wp-human-timing

一个函数,用于将时间字符串格式化为类似Twitter的、易读的人类时间格式。

dev-master 2015-11-23 20:10 UTC

This package is auto-updated.

Last update: 2024-09-15 01:36:15 UTC


README

一个函数,用于将时间字符串格式化为类似Twitter的、易读的人类时间格式。

用法

<?php cnp_human_timing( $string, '<h1 class="title">'. $string .'</h1>' ); ?>

参数

$time (必需): 用于计算经过时间的时间戳。

返回值

(字符串) 返回易读的人类时间。 (例如:3个月)。