Skip to content

Commit

Permalink
[#2893] - Restructured logger to use DateTimeImmutable to handle micr…
Browse files Browse the repository at this point in the history
…oseconds
  • Loading branch information
niden committed Feb 4, 2020
1 parent 8ecc627 commit ec529b7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions phalcon/Logger/Formatter/AbstractFormatter.zep
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,13 @@ abstract class AbstractFormatter implements FormatterInterface
{
var date, timezone;

let timezone = date_default_timezone_get(),
date = new DateTimeImmutable("now", new DateTimeZone(timezone));
let timezone = date_default_timezone_get();

if !timezone {
let timezone = "UTC";
}

let date = new DateTimeImmutable("now", new DateTimeZone(timezone));

return date->format(this->dateFormat);
}
Expand Down

0 comments on commit ec529b7

Please sign in to comment.