捕获致命错误:类DateTime的对象无法转换为字符串
$timestamp = "$day/$month/$year 00:00:00";
$timestamp = date_create_from_format('d/m/Y H:i:s', $timestamp);
echo $timestamp->format('Y-m-d H:i:s');
我该怎么办?
答案 0 :(得分:2)
$timestamp = new DateTime();
echo $timestamp->format('Y-m-d H:i:s');
你在寻找吗?