MyBB Community Forums

Full Version: my_date
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi guys I am using my_date with time relative but it don't show me seconds ago, how to show it?
$variable = my_date('relative', $bla['dateline']);
@sazze with 'relative' it don't show me seconds ago, but show me less than 1 minute ago
(09-11-2015, 01:13 PM)chack1172 Wrote: [ -> ]@sazze with 'relative' it don't show me seconds ago, but show me less than 1 minute ago

You'd have to edit a core file to make it "% seconds ago".
(09-10-2015, 09:10 PM)chack1172 Wrote: [ -> ]Hi guys I am using my_date with time relative but it don't show me seconds ago, how to show it?

Just did this to my forum, and it works:

1. Edit functions.php located in inc folder
2. Find

if($diff <= 60)
{
// Less than a minute
$relative['prefix'] = $lang->rel_less_than;
}

3. Replace it with

if($diff <= 60)
{
// seconds ago
return $diff == 1 ? $diff . ' second ago' : $diff . ' seconds ago';
}

[Image: GyVg8xX.png]