$date_str = substr($rfc3339_str, 0, 19);
$date_str = str_replace('T', ' ', $date_str);
return date('Y-m-d H:i:s', strtotime($date_str));
}
$rfc3339_str = '2020-05-20T10:00:00+08:00';
或
$rfc3339_str = '2024-08-10T02:07:18Z";
echo rfc3339_to_date($rfc3339_str); // 2020-05-20 10:00:00
上一篇:微信支付cURL error 60: SSL certificate problem: unable to get lo
下一篇:Cannot load privateKey from(string), please take care about