Hi
I'm trying to subtract exactly 24 hours from a timestamp.
2012-09-22 19:15:00
subtracted 24 hours with code below =>
2012-09-21 07:09:00 which is not what I want it to be I need it to be 2012-09-21 19:15:00
What am I doing wrong?
Thanks Nikolaj
Code:
$dato_begivenhed = $row['event_date'];
echo $dato_begivenhed;
echo "<br>";
$date = new DateTime($dato_begivenhed);
$date->modify("-24 hours");
echo $date->format("Y-m-d hs");