danbettles/php-medjool
Composer 安装命令:
composer require danbettles/php-medjool
包简介
Like PHP dates, only juicier
README 文档
README
A simple extension of PHP's Date/Time module, to make working with dates and times a little smoother. In general, I think Date/Time is actually pretty great. In some cases, though, things can feel a little clunky, so that's why Medjool is "like PHP dates, only juicier".
Overview
At Medjool's heart is the Date class, which is a Value Object—like DateTimeImmutable.
Of note:
- The constructor accepts a date-time string, an integer timestamp, a
DateTimeImmutable, or aDateTime, so there's no need to use different methods to create an instance. - Provides
toIsoDateTimeString(),toMysqlDateString(), andtoMysqlDateTimeString()to easily format the date. getComponents()gives you access to all/selected date and time components in one go.startOf()and its alias,trunc(), resets the date to the specified date component.isInPast()andisInFuture()simply read better.setTimezone()gives you the option to preserve the time.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: ISC
- 更新时间: 2026-06-23