tomasfejfar/datetime-strict
Composer 安装命令:
composer require tomasfejfar/datetime-strict
包简介
Simple DateTime wrapper allowing strict date and time validation
关键字:
README 文档
README
Simple wrapper around DateTime to allow strict datetime validation
Install via Composer
composer require tomasfejfar/datetime-strict
Usage
use TomasFejfar\DateTime\DateTimeStrict; use TomasFejfar\DateTime\StrictFormatException; try { $date = DateTimeStrict::createFromFormat('Y-m-d H:i:s', '2001-33-05 13:35:08'); } catch (StrictFormatException $e) { $warnings = $e->getWarnings(); $errors = $e->getErrors(); }
Usage for immutable variant is the same, just use DateTimeImmutableStrict::createFromFormat() instead.
Changelog
Changes can be found in each tag's annotation
Rules for contributing
- 1 PR per feature
- PR with tests are more likely to be merged
- tests and coding standard must pass
composer test
composer phpcs
Happy coding!
统计信息
- 总下载量: 103
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-10-10