Last active
March 19, 2016 18:23
-
-
Save klapuch/348c9c53b1d60a36313b to your computer and use it in GitHub Desktop.
Check if given data is valid DATETIME or not
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function isDateTime($input): bool { | |
return date('Y-m-d H:i:s', strtotime($input)) === $input; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment