2013-01-09 Hirofumi Kosaka <kosaka@rworks.jp>
* include/functions.php: Fixed that the console sometimes shows negative timestamp (e.g. '-2 sec') when using 'comparison in roll-over' format. Merged from 4.0.x. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7380 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
b981fc6add
commit
6d19ff0a33
|
@ -1,3 +1,9 @@
|
|||
2013-01-09 Hirofumi Kosaka <kosaka@rworks.jp>
|
||||
|
||||
* include/functions.php: Fixed that the console sometimes shows
|
||||
negative timestamp (e.g. '-2 sec') when using 'comparison in
|
||||
roll-over' format. Merged from 4.0.x.
|
||||
|
||||
2013-01-08 Dario Rodriguez <dario.rodriguez@artica.es>
|
||||
|
||||
* extensions/system_info.php: Added link to download System info file.
|
||||
|
|
|
@ -322,6 +322,13 @@ function human_time_comparation ($timestamp, $units = 'large') {
|
|||
}
|
||||
|
||||
$seconds = get_system_time () - $timestamp;
|
||||
|
||||
// $seconds could be negative, because get_system_time() could return cached value
|
||||
// (that might be the time a session begins at).
|
||||
// So negative values are to be rounded off to 'NOW'.
|
||||
if( $seconds < 0 ) {
|
||||
$seconds = 0;
|
||||
}
|
||||
|
||||
return human_time_description_raw($seconds, false, $units);
|
||||
}
|
||||
|
@ -1676,4 +1683,4 @@ function copy_dir($src, $dst) {
|
|||
}
|
||||
closedir($dir);
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue