Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
为什么我将以下日期转换为 Ymd 格式时会得到 1969。
$date1="01/02/2012"; echo date('Y-m-d',$date1);
注意:这是 php4。
您需要将日期字符串转换为时间戳:
echo date('Y-m-d', strtotime($date1));