rampesna/date-diff-calculator
最新稳定版本:v1.1.0
Composer 安装命令:
composer require rampesna/date-diff-calculator
包简介
Date Diff Calculator is a library that helps you to calculate the difference between two dates.
README 文档
README
This package is a simple date diff calculator. It calculates the difference between two dates and returns the result in a human readable format.
Requirements
- PHP >= 8.0
Installation
composer require rampesna/date-diff-calculator
Usage
Controller
use Rampesna\DateDiffCalculator; class ExampleController extends Controller { public function index(Request $request) { $permitStartDate = '2023-09-20 09:00:00'; $permitEndDate = '2023-10-10 18:00:00'; $dailyWorkingHours = 8; $dateDiffCalculator = new DateDiffCalculator( $dailyWorkingHours, $permitStartDate, $permitEndDate ); $minutes = $dateDiffCalculator->calculate(); return response()->json( $dateDiffCalculator->getDurationForHuman($minutes) ); } }
License
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-10-13