Download the PHP package chen-ht12306/chronos without Composer

On this page you can find all versions of the php package chen-ht12306/chronos. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package chronos

Chronos

一个优雅的 PHP 日期时间处理库,类似 Carbon,提供链式调用和丰富的时间操作方法。

特性

安装

Laravel 集成

注册服务提供者

在 config/app.php 中添加:

发布配置文件

快速开始

基本使用

日期操作

日期比较

日期差异

格式化输出

中文支持

时区处理

获取日期组件

测试支持

转换为其他类型

API 文档

静态工厂方法

方法 描述
now($tz) 获取当前时间
today($tz) 获取今天的日期
tomorrow($tz) 获取明天的日期
yesterday($tz) 获取昨天的日期
create($y, $m, $d, $h, $i, $s, $tz) 创建指定日期
parse($time, $tz) 解析日期字符串
createFromFormat($format, $time, $tz) 从格式创建
createFromTimestamp($timestamp, $tz) 从时间戳创建

实例方法

修改方法

方法 描述
addDays($n) 添加 n 天
subDays($n) 减去 n 天
addMonths($n) 添加 n 月
subMonths($n) 减去 n 月
addYears($n) 添加 n 年
subYears($n) 减去 n 年
addHours($n) 添加 n 小时
subHours($n) 减去 n 小时
startOfDay() 一天开始
endOfDay() 一天结束
startOfMonth() 月初
endOfMonth() 月末
startOfYear() 年初
endOfYear() 年末
setTimezone($tz) 设置时区

比较方法

方法 描述
equalTo($date) 是否等于
greaterThan($date) 是否大于
lessThan($date) 是否小于
isToday() 是否今天
isTomorrow() 是否明天
isYesterday() 是否昨天
isWeekend() 是否周末
isLeapYear() 是否闰年
diffInDays($date) 天数差异

格式化方法

方法 描述
format($format) 自定义格式
toDateString() Y-m-d
toTimeString() H:i:s
toDateTimeString() Y-m-d H:i:s
toCnDateString() 中文日期
toAtomString() ATOM 格式

配置

发布配置文件后,可以在 config/chronos.php 中修改:

贡献

欢迎提交 Issue 和 Pull Request!

许可证

MIT License


All versions of chronos with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/contracts Version ^10.0|^11.0
illuminate/support Version ^10.0|^11.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package chen-ht12306/chronos contains the following files

Loading the files please wait ...