hanakivan / date-formats
Human readable constants ready to be used instead of guessing what date parameter to use.
Installs: 187
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:package
README
Human readable constants ready to be used instead of guessing what date parameter to use.
Installation
With composer
$ composer require hanakivan/date-formats
{ "require": { "hanakivan/date-formats": "^3.0" } }
Usage
use hanakivan\DateFormats; $now = new \DateTime(); //prints current date, e.g. 20. 8. 2020 echo $now->format(DateFormats::DATE_FORMAT);
Available formats
DATETIME_FORMAT
// => "j. n. Y G:i" or "23. 12. 2020 19:00"DATETIME_FORMAT_US
// => "m/d/y g:ia" or "12/23/20 7:00pm"TIME_FORMAT
// => "G:i" or "19:00"TIME_FORMAT_US
// => "g:ia" or "7:00pm"DATE_FORMAT
// => "j. n. Y" or "23. 12. 2020DATE_FORMAT_US
// => "m/d/y" or "12/23/20"MONTH_FULL_NAME
// => "F" or e.g. January, March, DecemberMONTH_NUMBER
// => "n" or e.g. 1, 2, 12FULL_YEAR
// => "Y" or e.g. 2020...DAY_NUMBER
// => "j"; day number without leading zero, e.g. 1, 4, 10, 31...