Fix incorrect value of DateTime::formatTimestamp() if timestamp is not given

This commit is contained in:
Kijin Sung 2016-05-23 23:43:04 +09:00
parent 9a7445b677
commit 3ee6eaa363

View file

@ -22,7 +22,7 @@ class DateTime
public static function formatTimestamp($format, $timestamp = null)
{
$offset = Config::get('locale.internal_timezone') ?: date('Z', $timestamp);
return gmdate($format, $timestamp + $offset);
return gmdate($format, ($timestamp ?: time()) + $offset);
}
/**