Skip to content

Commit

Permalink
Update system/I18n/Time.php
Browse files Browse the repository at this point in the history
apply suggestion

Co-authored-by: kenjis <kenji.uui@gmail.com>
  • Loading branch information
Toto and kenjis committed Jan 18, 2022
1 parent 67665c2 commit a7dfa5f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions system/I18n/Time.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,10 @@ public static function createFromFormat($format, $datetime, $timezone = null)
*/
public static function createFromTimestamp(int $timestamp, $timezone = null, ?string $locale = null)
{
$time = new self(gmdate('Y-m-d H:i:s', $timestamp), 'UTC', $locale);
$timezone ??= 'UTC';
$date = new DateTime('now', new DateTimeZone($timezone));

return new self($date->setTimestamp($timestamp)->format('Y-m-d H:i:s'), $timezone, $locale);
return $time->setTimezone($timezone);
}

/**
Expand Down

0 comments on commit a7dfa5f

Please sign in to comment.