|
|
@@ -51,7 +51,7 @@ class DateTimeType extends \Cake\Database\Type {
|
|
|
/**
|
|
|
* Convert DateTime instance into strings.
|
|
|
*
|
|
|
- * @param string|DateTime $value The value to convert.
|
|
|
+ * @param string|integer|DateTime $value The value to convert.
|
|
|
* @param Driver $driver The driver instance to convert with.
|
|
|
* @return string
|
|
|
*/
|
|
|
@@ -59,6 +59,9 @@ class DateTimeType extends \Cake\Database\Type {
|
|
|
if ($value === null || is_string($value)) {
|
|
|
return $value;
|
|
|
}
|
|
|
+ if (is_int($value)) {
|
|
|
+ $value = new static::$dateTimeClass('@' . $value);
|
|
|
+ }
|
|
|
return $value->format($this->_format);
|
|
|
}
|
|
|
|