1
0
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:
Jordi Boggiano
2016-05-26 17:39:41 +01:00
parent 912d813c73
commit 76a91c6722
8 changed files with 27 additions and 14 deletions

View File

@@ -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();
}
}