Skip to content

Commit 7767aee

Browse files
Merge remote-tracking branch 'origin/MAGETWO-35359' into BUGS
2 parents 9699dc1 + a5bc4e3 commit 7767aee

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/internal/Magento/Framework/Stdlib/DateTime/Timezone.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,11 @@ public function formatDate($date = null, $format = \IntlDateFormatter::SHORT, $s
197197
public function scopeTimeStamp($scope = null)
198198
{
199199
$timezone = $this->_scopeConfig->getValue($this->getDefaultTimezonePath(), $this->_scopeType, $scope);
200-
return (new \DateTime('now', new \DateTimeZone($timezone ?: 'UTC')))->getTimestamp();
200+
$currentTimezone = @date_default_timezone_get();
201+
@date_default_timezone_set($timezone);
202+
$date = date('Y-m-d H:i:s');
203+
@date_default_timezone_set($currentTimezone);
204+
return strtotime($date);
201205
}
202206

203207
/**

0 commit comments

Comments
 (0)