php count second different

Solutions on MaxInterview for php count second different by the best coders in the world

showing results for - "php count second different"
Zaine
30 Mar 2016
1<?php
2
3$hour1 = '12:00:00';
4$hour2 = '09:00:00';
5
6$o1 = new DateTime($hour1);
7$o2 = new DateTime($hour2);
8
9$diff = $o1->diff($o2,true); // to make the difference to be always positive.
10
11echo $diff->format('%H:%I:%S');
12
similar questions
queries leading to this page
php count second different