I use this code:
$today_date = new DateTime('now');
$final_date = new DateTime('2012-03-22 09:00');
$interval = $today_date->diff($final_date);
$time_left = $interval->format('%d:%H:%i:%s');
I want $time_left to have the format dd:hh:mm:ss format (d-> day, h-> hour, m-> minute, s-> seconds).
But when i used %d:%H:%i:%s as format, it sometimes displays single number, that is without 0 padding for minute. For example: 11:14:7:45. Expected result: 11:14:07:45
Any mistakes ?