Reminder left and ago
Posted: 2015-05-10 14:03
hi can someone help me,
this my code
function timetable_after_update($data, $memberInfo, &$args){
$then = date("Y-m-d H:i:s", strtotime("{$data['date']} {$data['time']}"));
$then = new DateTime($then);
$now = new DateTime();
$sinceThen = $then->diff($now);
$data['reminder'] = $sinceThen->d." days ".$sinceThen->h." hours ".$sinceThen->i." mins left";
return TRUE;
}
i want to change mins left to ago when the time expired, please someone guide me.
this my code
function timetable_after_update($data, $memberInfo, &$args){
$then = date("Y-m-d H:i:s", strtotime("{$data['date']} {$data['time']}"));
$then = new DateTime($then);
$now = new DateTime();
$sinceThen = $then->diff($now);
$data['reminder'] = $sinceThen->d." days ".$sinceThen->h." hours ".$sinceThen->i." mins left";
return TRUE;
}
i want to change mins left to ago when the time expired, please someone guide me.