Calculate number of days,hours, minute, seconds passed from todays date to some past date

<?php function get_time_differenceFromToday($fromDate) { $uts[‘start’] = strtotime( $fromDate );//date format YYYY-MM-DD HH:MM:SS $uts[‘end’] = time();//unix timestamp //strtotime( $end ) if( $uts[‘start’]!==-1 && $uts[‘end’]!==-1 ) { if( $uts[‘end’] >= $uts[‘start’] ) { $diff = $uts[‘end’] – $uts[‘start’]; if($diff > 604800) {