function isValidDateTimeString($str_dt, $str_dateformat, $str_timezone) { $date = DateTime::createFromFormat($str_dateformat, $str_dt, new DateTimeZone($str_timezone)); return $date && DateTime::getLastErrors()["warning_count"] == 0 && DateTime::getLastErrors()["error_count"] == 0;}
No comments:
Post a Comment