Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $createdAt = new \DateTime();
- echo $createdAt->format('d.m.Y h:i:s'). "\n";
- $fiveMinLater = (clone $createdAt)->add(new \DateInterval('PT5M'));
- echo $fiveMinLater->format('d.m.Y h:i:s') . "\n";
- $diff = $fiveMinLater->diff($createdAt)->format('%i');
- if ((int)$diff == 5){
- echo "Different is 5 minutes \n";
- }
Add Comment
Please, Sign In to add comment