turbopixel/datr
最新稳定版本:0.2.0
Composer 安装命令:
composer require turbopixel/datr
包简介
Created for simple date conversion with predefined date formats.
README 文档
README
What is Datr?
A simple date converter library in PHP.
Dependencies
- >= PHP 7.4 is required
Get Started
You can find this library at packagist.org.
Just add Datr to the composer.json configuration file:
composer require turbopixel/datr
And update the composer:
composer update
Examples
// format date var_dump( Datr::toGermanDate("2022-07-12") ); var_dump( Datr::toGermanDateTime("2022-07-12 02:47:12") ); var_dump( Datr::toEnglishDate("12.07.2022") ); var_dump( Datr::toEnglishDateTime("12.07.2022 08:12:55") ); // alias for toSql() var_dump( Datr::toSql("12.07.2022 08:12:55") ); // output string(10) "12.07.2022" string(19) "12.07.2022 02:47:12" string(10) "2022-07-12" string(19) "2022-07-12 08:12:55" string(19) "2022-07-12 08:12:55" // date validation var_dump(Datr::isValid("12.07.2022 08:12:55", "d.m.Y")); bool(false) // -> wrong format var_dump(Datr::isValid("12.07.2022 08:12:55", "d.m.Y H:i:s")); bool(true)
Contribution
Anyone can contribute to improve or fix Datr, to do so you can either report an issue (a bug, an idea...) or fork the repository, perform modifications to your fork then request a merge.
Roadmap
- pre define special country date formats
统计信息
- 总下载量: 190
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-07-12