定制 magicspacepanda/time-duration 二次开发

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

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

magicspacepanda/time-duration

Composer 安装命令:

composer require magicspacepanda/time-duration

包简介

Convert durations into human-readable timestamps.

README 文档

README

Latest Stable Version Build Status

This library was created to make parsing time entered into a task manager as easy as it is on popular apps like Harvest or Tempo for JIRA.

Requirements

  • PHP 7.2 or higher
  • Composer (if used as library)

Install

With Composer

composer require magicspacepanda/time-duration

How to Use

use MagicSpacePanda\TimeDuration;

// Handles durations as a float (1 hour and 45 minutes)
$floatTime = TimeDuration::createFromNumeric(1.75);
printf("Time spend on project is %s", $floatTime);

// Handles durations as an integer (3 hours)
$intTime = TimeDuration::createFromNumeric(1);
printf("Time spend on project is %s", $intTime);

// Handles durations as a string (5 hours and 25 minutes)
$strTime = TimeDuration::createFromString('5h 25m');
printf("Time spend on project is %s", $strTime);

// Convert output to DateTime instance
$floatTime->toDateTime();

// Convert output to custom format
$intTime->toFormat('H:i');

// Convert output to machine-friendly milliseconds
$strTime->toMilliseconds();

Contributing

If you would like to contribute to this library, please create a pull request for me to review. Should your code be accepted I will add your name below.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-11-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固