Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php check valid time format

function isValidDate(string $date, string $format = 'Y-m-d'): bool
{
    $dateObj = DateTime::createFromFormat($format, $date);
    return $dateObj && $dateObj->format($format) == $date;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #check #valid #time #format
ADD COMMENT
Topic
Name
9+6 =