jasperalani/unix-time

包含预设和倍数以快速生成秒数的库。

1.0.0 2020-10-16 16:09 UTC

This package is auto-updated.

Last update: 2024-09-24 03:08:09 UTC


README

UnixTime

PHP 库,包含预设和倍数以快速生成秒数。

版本 1.0.2

用法

使用方法就像 new UnixTime('5m');

echo new UnixTime("5m"); // five minutes: 300

$time = new UnixTime('5m', 'x3'); // fifteen minutes: 900
$time = new UnixTime('three_years', 'x2');

echo $time->time(); // time() function returns the time
$time->time(true); // specify echo argument to echo the time
echo $time->format(); // format() functions returns the current time + preset time

待办事项

  • 创建更好的预设系统,允许在有效标识符前使用任何数字,例如 s 表示秒,m 表示分钟。
  • 创建更好的倍数系统,允许使用多个倍数作为参数。