I want to convert a human readable date time such as 20210419115522
to 2021-04-19 11:55:22
via PHP
. How is it possible?
<?php echo date('Ymd', 20210419115301); <------ Not the result I expect
Advertisement
Answer
ex: $time = strtotime(“20210419115301”); echo date(“Y-m-d H:i:s”, $time);