When microtime(true) returns a whole number, then the parsing fails.

This patch makes sure, that the value can always be parsed correctly.
This commit is contained in:
Christian Schnidrig 2015-12-22 15:06:32 +01:00
parent 5e3710d746
commit 7fce06b3f3

View file

@ -73,7 +73,7 @@ class OC_Log_Owncloud {
} catch (Exception $e) {
$timezone = new DateTimeZone('UTC');
}
$time = DateTime::createFromFormat("U.u", microtime(true), $timezone);
$time = DateTime::createFromFormat("U.u", number_format(microtime(true), 4, ".", ""), $timezone);
if ($time === false) {
$time = new DateTime(null, $timezone);
}