你如何解决以下错误:
Fatal error: Call to undefined method DateTime::createfromformat()
错误发生在第35行.这是我的代码从第31行到第45行读取的内容
// check database for necessary updates $update = MysqL_query("SELECT * FROM rent WHERE colour='#3C0'"); while($row_update = MysqL_fetch_array( $update )) { $datetime_lower = DateTime::createFromFormat('d/m/Y',$min); $datetime_upper = DateTime::createFromFormat('d/m/Y',$max); $datetime_compare = DateTime::createFromFormat('d/m/Y g:i a',$row_update['pDate']); if ($datetime_lower < $datetime_compare && $datetime_upper > $datetime_compare) { // date is between do nothing } else { // date is not between so update $update_result = MysqL_query("UPDATE rent SET colour='#F0F0F0' WHERE id=" . $row_update['id'] . " && colour='#3C0'"); MysqL_close($update_result); } }
我该如何解决这个问题?