定制 xenon/datetime-calc 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

xenon/datetime-calc

最新稳定版本:v0.0.1-alpha

Composer 安装命令:

composer require xenon/datetime-calc

包简介

This is a date time calculation library for php based on Carbon

README 文档

README

Breakdown and Splitting Time Range

    $time = new TimeBreakDown(
        startTime: '11:00', 
        endTime: '12:00'
    );
    $time->setIntervalMinute(30);
    $time->setBreakDuration(2);
    $time->includeBreaks(1);
    $data = $time->getIntervals(
        breakString: 'is_break',
        startTimeFormat: 'H:i:s',
        endTimeFormat: 'H:i:s'
    );

This will print below time split with 30mins breaks in every stage and it has 2mins break als

Array
(
    [0] => Array
        (
            [start] => 11:00:00
            [end] => 11:30:00
        )

    [1] => Array
        (
            [start] => 11:30:00
            [end] => 11:32:00
            [is_break] => 1
        )

    [2] => Array
        (
            [start] => 11:32:00
            [end] => 12:02:00
        )

    [3] => Array
        (
            [start] => 12:02:00
            [end] => 12:04:00
            [is_break] => 1
        )

)

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-12-28