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.
Reminder left and ago
Re: Reminder left and ago
Hmm .. how about:
Code: Select all
if($now > $then){
$data['reminder'] = $sinceThen->d." days ".$sinceThen->h." hours ".$sinceThen->i." mins ago";
}else{
$data['reminder'] = $sinceThen->d." days ".$sinceThen->h." hours ".$sinceThen->i." mins left";
}

- DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
- Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.
- Need personalized consulting on your specific app and customizations? Book an online call with me here.
Re: Reminder left and ago
its work with sql 5.5+ but not work in sql 5.1 or sql 5.2, im new in php + sql coding. what im missing?? please lend me some help here 

Re: Reminder left and ago
sorry im nailed it, my last question how to do cron job to update field?