mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-15 06:40:59 +08:00
@ -339,7 +339,7 @@ class Formatter extends Component
|
||||
{
|
||||
if (is_string($value)) {
|
||||
return is_numeric($value) || $value === '' ? (int)$value : strtotime($value);
|
||||
} elseif ($value instanceof DateTime) {
|
||||
} elseif ($value instanceof DateTime || $value instanceof \DateTimeInterface) {
|
||||
return $value->getTimestamp();
|
||||
} else {
|
||||
return (int)$value;
|
||||
|
Reference in New Issue
Block a user