Skip to content

Commit 0bb6483

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 a51b07c commit 0bb6483

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
@@ -1121,12 +1121,11 @@ protected static function hasRelativeKeywords(string $time): bool
11211121

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

11321131
/**

0 commit comments

Comments
 (0)