use output of command date as datestring

this will imply the system time zone. command date and the given format
are supported by the majority of linux distros
This commit is contained in:
Jakob Ackermann
2016-10-09 03:06:09 +02:00
parent 4028a3f833
commit 9cd0f4b4fa
+2 -2
View File
@@ -4,10 +4,10 @@ $ERRORLOG = getenv('PHP_ERROR_LOG');
if (empty($ERRORLOG)) {
$ERRORLOG = '/var/log/lighttpd/error.log';
}
date_default_timezone_set('UTC');
$date = exec("date +'%Y-%m-%d %H:%M:%S'");
function pi_log($message) {
error_log(date('Y-m-d H:i:s') . ': ' . $message . "\n", 3, $GLOBALS['ERRORLOG']);
error_log($date . ': ' . $message . "\n", 3, $GLOBALS['ERRORLOG']);
}
function log_and_die($message) {