Skip to content

Commit e856118

Browse files
committed
fix: now Time::__toString() does not depend on locale
It always returns string like '2016-03-09 12:00:00'.
1 parent 31ae195 commit e856118

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

system/I18n/Time.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,12 +1122,11 @@ protected static function hasRelativeKeywords(string $time): bool
11221122

11231123
/**
11241124
* Outputs a short format version of the datetime.
1125-
*
1126-
* @throws Exception
1125+
* The output is NOT localized intentionally.
11271126
*/
11281127
public function __toString(): string
11291128
{
1130-
return IntlDateFormatter::formatObject($this->toDateTime(), $this->toStringFormat, $this->locale);
1129+
return $this->format('Y-m-d H:i:s');
11311130
}
11321131

11331132
/**

0 commit comments

Comments
 (0)