Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 1 | Rev 14681 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 14680
Línea 61... Línea 61...
61
    }
61
    }
Línea 62... Línea 62...
62
    
62
    
63
    /**
63
    /**
64
     * 
64
     * 
-
 
65
     * @param int $ptime
65
     * @param int $ptime
66
     * @param int $now
66
     * @return string
67
     * @return string
67
     */
68
     */
68
    public static function timeElapsedString(int $ptime) 
69
    public static function timeElapsedString(int $ptime, $now = null) 
-
 
70
    {
-
 
71
        if($now)  {
-
 
72
            $etime = $now - $ptime;
-
 
73
            
69
    {
74
        } else {
-
 
75
            $etime = time() - $ptime;
-
 
76
        }
-
 
77
        
70
        $etime = time() - $ptime;
78
        
71
        if ($etime < 1) {
79
        if ($etime < 1) {
72
            return 'LABEL_ZERO_SECOND';
80
            return 'LABEL_ZERO_SECOND';
73
        }
81
        }
74
        $a = array(365 * 24 * 60 * 60 => 'LABEL_YEAR_SMALL',
82
        $a = array(365 * 24 * 60 * 60 => 'LABEL_YEAR_SMALL',
Línea 505... Línea 513...
505
            return true;
513
            return true;
Línea 506... Línea 514...
506
            
514
            
507
        }
515
        }
508
        catch (\Throwable $e)
516
        catch (\Throwable $e)
-
 
517
        {
509
        {
518
            print_r($e);
510
            error_log($e->getTraceAsString());
519
            error_log($e->getTraceAsString());
511
            return false;
520
            return false;
512
        }
521
        }