mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-22 17:16:18 +02:00
Set default date format to have a timezone, fixes #196
This commit is contained in:
@@ -34,10 +34,7 @@ class DateTimeImmutable extends \DateTimeImmutable implements \JsonSerializable
|
||||
$this->useMicroseconds = $useMicroseconds;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function jsonSerialize()
|
||||
public function jsonSerialize(): string
|
||||
{
|
||||
if ($this->useMicroseconds) {
|
||||
return $this->format('Y-m-d\TH:i:s.uP');
|
||||
@@ -45,4 +42,9 @@ class DateTimeImmutable extends \DateTimeImmutable implements \JsonSerializable
|
||||
|
||||
return $this->format('Y-m-d\TH:i:sP');
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->jsonSerialize();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user