定制 repat/date-constants 二次开发

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

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

repat/date-constants

最新稳定版本:2.0.1

Composer 安装命令:

composer require repat/date-constants

包简介

A series of constants designed to make it easier to express dates in PHP applications

README 文档

README

Build Status Packagist

The Date Constants package defines a number of useful PHP constants within your application, making it easier to express measures of dates.

These constants may seem familiar to Laravel developers, as they're absolutely inspired by Nesbot\Carbons use of date constants. Also, shoutout to the stevegrunwell/time-constants package for the idea.

Installation

Date Constants is intended to be installed via Composer:

$ composer require repat/date-constants

The package has been configured to automatically expose the constants.php file via the Composer-generated autoloader, so you'll be ready to use the constants as soon as the package has been installed!

Defined constants

This is a list of all constants defined by this package, along with their values. Each constant is wrapped in a if (! defined(...)) conditional, ensuring these constants can easily be redefined if necessary and won't conflict with existing constants.

From Carbon

  • YEARS_PER_CENTURY (100)
  • YEARS_PER_DECADE (10)
  • MONTHS_PER_YEAR (12)
  • WEEKS_PER_YEAR (52)
  • DAYS_PER_WEEK (7)
  • HOURS_PER_DAY (24)

Days of the week

  • SUNDAY (0)
  • MONDAY (1)
  • TUESDAY (2)
  • WEDNESDAY (3)
  • THURSDAY (4)
  • FRIDAY (5)
  • SATURDAY (6)

Misc

  • DAYS_PER_YEAR (365)
  • DAYS_PER_LEAP_YEAR (366)
  • DAYS_PER_FORTNIGHT (14)

Months

  • JANUARY (1)
  • FEBRUARY (2)
  • MARCH (3)
  • APRIL (4)
  • MAY (5)
  • JUNE (6)
  • JULY (7)
  • AUGUST (8)
  • SEPTEMBER (9)
  • OCTOBER (19)
  • NOVEMBER (11)
  • DECEMBER (12)

Amount of days

  • DAYS_JAN (31)
  • DAYS_FEB (28)
  • DAYS_FEB_LEAP (29)
  • DAYS_MAR (31)
  • DAYS_APR (30)
  • DAYS_JUN (31)
  • DAYS_JUL (30)
  • DAYS_AUG (31)
  • DAYS_SEP (30)
  • DAYS_OCT (31)
  • DAYS_NOV (30)
  • DAYS_DEC (31)

TODO

  • Finish Tests

Version

  • Version 2.0.1

Contact

repat

Flattr this git repo

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固