inquid / yii2-date-time-handler
yii2 的日期时间处理器
dev-master
2019-01-10 22:01 UTC
Requires
- nesbot/carbon: ^2.5
- yiisoft/yii2: ~2.0.0
This package is auto-updated.
Last update: 2024-08-29 04:37:42 UTC
README
Yii2 Datetime Handler
yii2 的日期时间处理器
安装
安装此扩展的首选方式是通过 composer。
运行以下命令之一
php composer.phar require --prefer-dist inquid/yii2-date-time-handler "*"
或者
"inquid/yii2-date-time-handler": "*"
将以下内容添加到你的 composer.json
文件的 require 部分中。
使用方法
安装扩展后,只需按照以下方式使用你需要的函数
\inquid\date_time\DateTimeHandler::formatDate($date,'Y-m-d'); \inquid\date_time\DateTimeHandler::now(); \inquid\date_time\DateTimeHandler::getWeekNumberByDate('2018-09-09');
就这样!