有没有人知道有没有内置或快速的函数来检查字符串是否为MySQL日期时间格式?下面是一个示例:
2038-01-19 03:14:07发布于 2013-04-07 11:54:22
您可以尝试DateTime::createFromFormat('Y-m-d H:i:s', '2038-01-19 03:14:07'),看看它是否返回false。http://www.php.net/manual/en/datetime.createfromformat.php
https://stackoverflow.com/questions/15858685
复制相似问题