I have timestamps in array like this: 20221206235959
If I do this:
$start_time = $book->booking_start;
echo (date('F j, Y',$start_time));
Result is: July 1, 642735
How can I change it to something like this: 06.12.2022 23:59:59
?
I have timestamps in array like this: 20221206235959
If I do this:
$start_time = $book->booking_start;
echo (date('F j, Y',$start_time));
Result is: July 1, 642735
How can I change it to something like this: 06.12.2022 23:59:59
?
I think you need to parse and format the input datetime
value:
<?php
$start_time = '20221206235959';
echo DateTime::createFromFormat('YmdHis', $start_time)->format("d.m.Y H:i:s");
?>
Result:
06.12.2022 23:59:59