<?php $startDate = date_create_from_format( 'Y-m-d H:i', '2021-03-28 08:45', new DateTimeZone("Europe/Madrid") ); $startMinusDays = (clone $startDate)->sub(new DateInterval('P3D')); $startMinusHours = (clone $startDate)->sub(new DateInterval('PT72H')); echo "Date: : ".$startDate->format('Y-m-d H:i:s'); echo "\n"; echo "Date - 3 Days : ".$startMinusDays->format('Y-m-d H:i:s'); echo "\n"; echo "Date - 72 Hours: ".$startMinusHours->format('Y-m-d H:i:s');
You have javascript disabled. You will not be able to edit any code.