Skip to content

Instantly share code, notes, and snippets.

@klapuch
Last active March 19, 2016 18:23
Show Gist options
  • Save klapuch/348c9c53b1d60a36313b to your computer and use it in GitHub Desktop.
Save klapuch/348c9c53b1d60a36313b to your computer and use it in GitHub Desktop.
Check if given data is valid DATETIME or not
<?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