Answers for "php check if type is datetime"

PHP
1

php check if input is date

function isRealDate($date) { 
    if (false === strtotime($date)) { 
        return false;
    } 
    list($year, $month, $day) = explode('-', $date); 
    return checkdate($month, $day, $year);
}
Posted by: Guest on November-08-2020
0

php is datetime

#Object oriented style

public DateTime::format(string $format): string
public DateTimeImmutable::format(string $format): string
public DateTimeInterface::format(string $format): string
  
#Procedural style

#date_format(DateTimeInterface $object, string $format): string
#Returns date formatted according to given format.
Posted by: Guest on August-03-2021

Code answers related to "php check if type is datetime"

Browse Popular Code Answers by Language