mirror of
https://github.com/smarty-php/smarty.git
synced 2025-10-29 11:21:36 +01:00
- bugfix smarty_make_timestamp() failed to process DateTime objects properly
This commit is contained in:
@@ -20,7 +20,7 @@ function smarty_make_timestamp($string)
|
||||
// use "now":
|
||||
return time();
|
||||
} elseif ($string instanceof DateTime) {
|
||||
return $string->source->timestamp;
|
||||
return $string->getTimestamp();
|
||||
} elseif (strlen($string) == 14 && ctype_digit($string)) {
|
||||
// it is mysql timestamp format of YYYYMMDDHHMMSS?
|
||||
return mktime(substr($string, 8, 2),substr($string, 10, 2),substr($string, 12, 2),
|
||||
|
||||
Reference in New Issue
Block a user