Simple wrapper around DateTime to allow strict datetime validation
composer require tomasfejfar/datetime-strict
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();
}
- 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!