<?php
$dtA = new DateTime("01-12-2015 6:55am");
$dtB = new DateTime('now');
$diff = $dtA->diff($dtB);
if ( ( ($diff->days * 24 ) * 60 ) + ( $diff->i ) > 1440)
echo "24 hours has passed.";
else
echo "has not reached the 24 hour mark.";
- Output for 5.6.28, 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
- has not reached the 24 hour mark.
- Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.21, 7.0.0 - 7.0.6
- 24 hours has passed.
preferences:
202.91 ms | 402 KiB | 228 Q