Hi,
I have noticed that server PHP error log file, as in:
/var/www/vhosts/example.com/logs/PHP_errors.log
Losses its pre configured local time zone, and switches to UTC.
Plugin uses time zone, as in Carbon.php file:
public function __construct($time = null, $tz = null)
...
$timezone = static::safeCreateDateTimeZone($tz);
...
public static function now($tz = null)
{
return new static(null, $tz);
}
...
protected static function safeCreateDateTimeZone($object)
{
if ($object === null) {
// Don't return null... avoid Bug #52063 in PHP <5.3.6
return new DateTimeZone(\date_default_timezone_get());
}
if ($object instanceof DateTimeZone) {
return $object;
}
if (\is_numeric($object)) {
$tzName = \timezone_name_from_abbr(null, $object * 3600, \true);
...
public static function createFromTimestampUTC($timestamp)
{
return new static('@' . $timestamp);
}
...
public function toIso8601ZuluString()
{
return $this->copy()->setTimezone('UTC')->format('DeliciousBrains\\WP_Offload_SES\\Y-m-d\\TH:i:s\\Z');
}
...
public function toISOString($keepOffset = \false)
{
if ($this->year === 0) {
return null;
}
$year = $this->year < 0 || $this->year > 9999 ? ($this->year < 0 ? '-' : '+') . \str_pad(\abs($this->year), 6, '0', \STR_PAD_LEFT) : \str_pad($this->year, 4, '0', \STR_PAD_LEFT);
$tz = $keepOffset ? $this->format('P') : 'Z';
$date = $keepOffset ? $this : $this->copy()->setTimezone('UTC');
return $year . $date->format('-m-d\\TH:i:s.u') . $tz;
}
...
public function toW3cString()
{
return $this->format(static::W3C);
}
/**
* Format the instance as RFC7231
*
* @return string
*/
public function toRfc7231String()
{
return $this->copy()->setTimezone('GMT')->format(static::RFC7231_FORMAT);
}
Please note: I suspect answering a specific certain condition/s, is the circumstances, that possibly brings the plugin to undesirably manipulate the PHP/Server ‘timezone
‘ (PHP: date.timezone
), which was pre configured by admin.
May I ask, if it could be the WP Offload SES usage of timezone
var, causes this undesired affect?
And if so, how should it be fixed?
- This topic was modified 8 hours, 4 minutes ago by .