Update class basic, bug fixes for acl unit set in login class

class basic has a simple date string format method. returns Y-m-d h:i:s
for a trimestring, optional microseconds too
bug fix for unit/edit access id check in login class
This commit is contained in:
Clemens Schwaighofer
2016-08-27 13:28:42 +09:00
parent 31bef7a531
commit adf46f620b
3 changed files with 18 additions and 2 deletions

View File

@@ -1081,6 +1081,20 @@
return $number;
}
// METHOD: DateStringFormat
// PARAMS: unix timestamp, true/false to show microtime
// RETURN: string formated date+time in Y-M-D h:m:s
// DESC : a simple wrapper for the date format
public static function DateStringFormat($timestamp, $show_micro = true)
{
list ($timestamp, $ms) = explode('.', round($timestamp, 4));
if ($show_micro)
$string = date("Y-m-d H:i:s", $timestamp).' '.$ms.'ms';
else
$string = date("Y-m-d H:i:s", $timestamp);
return $string;
}
// METHOD: TimeStringFormat
// PARAMS: seconds
// RETURN: formated time string