概要
閲覧数:4314
投稿日:2016-02-02
更新日:2016-02-02
"2016-12-31T23:59" → "2016-12-31-23-59-00"
コード
$datetimeLocal = "2016-12-31T23:59";
$datetimeLocal = str_replace(array("T", ":"), "-", $datetimeLocal); //Tと:を-へ変更
$datetimeLocal = $datetimeLocal."-00";
echo $datetimeLocal;結果
"2016-12-31-23-59-00"