Modification Function

325
.
Devendraoli
Can we add extra functionality to the function display_date ?
Which displays the time ago, while currently we have basic function like Today and Yesterday only.
It will be more better if we can add time ago --> (s) ago
Second
Minutes
Hour
Day
Month


public static function display_date($var)
    {
        $shift = (self::$system_set['timeshift'] + self::$user_set['timeshift']) * 3600;
        if (date('Y', $var) == date('Y', time())) {
            if (date('z', $var + $shift) == date('z', time() + $shift)) {
                return self::$lng['today'] . ', ' . date("H:i", $var + $shift);
            }
            if (date('z', $var + $shift) == date('z', time() + $shift) - 1) {
                return self::$lng['yesterday'] . ', ' . date("H:i", $var + $shift);
            }
        }
 
        return date("d.m.Y / H:i", $var + $shift);
    }
.
Devendraoli, yes it is possible. Today, i will write.
.
mRWiNeT
#НетВойне #NoWar #НіВійні
Here's the code, but it needs to be to celebrate. And then, wherever you want to change the output varying functions of time.
* (+/-)


П.С. переводил через гугл, не знаю все правильно написано.
.
Devendraoli, if i understand correctly, then you need this option
code (+/-)
Всего: 4