seffeng/time-helper

PHP extension time helper

v0.1.1 2024-01-24 01:57 UTC

This package is auto-updated.

Last update: 2024-11-24 03:53:40 UTC


README

安装

# 安装
$ composer require seffeng/time-helper

目录说明

|---src
|   |   Time.php
|   |---Traits
|           TimeTrait.php
|---tests
|       TimeTest.php

示例

/**
 * TestController.php
 * 示例
 */
namespace App\Http\Controllers;

use Seffeng\TimeHelper\Time;

class TestController extends Controller
{
    public function index()
    {
        var_dump(Time::asWeekCN(time()));

        var_dump(Time::asTimestampDiff(strtotime('2022-01-01'), time()));
    }
}

备注

1、更多示例请参考 tests 目录下测试文件。