Skip to content

Commit cde4a28

Browse files
committed
Refrain from passing the timezone when calling date_create() with a timestamp
"The $timezone parameter and the current timezone are ignored when the $datetime parameter [...] is a UNIX timestamp (e.g. @946684800)" See https://www.php.net/manual/en/datetime.construct.php
1 parent 5de5174 commit cde4a28

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/php/util/Date.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function __construct($in= null, TimeZone $timezone= null) {
4747

4848
// Specially mark timestamps for parsing (we assume here that strings
4949
// containing only digits are timestamps)
50-
$this->handle= date_create('@'.$in, timezone_open('UTC'));
50+
$this->handle= date_create('@'.$in);
5151
date_timezone_set($this->handle, $timezone ? $timezone->getHandle() : timezone_open(date_default_timezone_get()));
5252
} else {
5353
try {

0 commit comments

Comments
 (0)