File "DateTimeImmutable.php"
Full Path: /home/warrior1/public_html/plugins/mailpoet/vendor-prefixed/monolog/monolog/src/Monolog/DateTimeImmutable.php
File size: 643 bytes
MIME-type: text/x-php
Charset: utf-8
<?php
declare (strict_types=1);
namespace MailPoetVendor\Monolog;
if (!defined('ABSPATH')) exit;
use DateTimeZone;
class DateTimeImmutable extends \DateTimeImmutable implements \JsonSerializable
{
private $useMicroseconds;
public function __construct(bool $useMicroseconds, ?DateTimeZone $timezone = null)
{
$this->useMicroseconds = $useMicroseconds;
parent::__construct('now', $timezone);
}
public function jsonSerialize() : string
{
if ($this->useMicroseconds) {
return $this->format('Y-m-d\\TH:i:s.uP');
}
return $this->format('Y-m-d\\TH:i:sP');
}
public function __toString() : string
{
return $this->jsonSerialize();
}
}