diff options
author | royalterra <royalterra@users.noreply.github.com> | 2015-12-11 09:39:01 +0000 |
---|---|---|
committer | royalterra <royalterra@users.noreply.github.com> | 2015-12-11 09:39:01 +0000 |
commit | 4ff31d0a4140d923cbb8ddbe18ccf578a367375f (patch) | |
tree | 1f63d4b042c3dbf7bfe2c3e74f0a24ef2e5f94ec /library/Smarty/libs/plugins/shared.make_timestamp.php | |
parent | b92cc852d142940f0f8dd78ddf7be835dc8b9e07 (diff) | |
parent | f73c82632f213ac7971b54220b4a0c87d354ca1e (diff) | |
download | volse-hubzilla-4ff31d0a4140d923cbb8ddbe18ccf578a367375f.tar.gz volse-hubzilla-4ff31d0a4140d923cbb8ddbe18ccf578a367375f.tar.bz2 volse-hubzilla-4ff31d0a4140d923cbb8ddbe18ccf578a367375f.zip |
Merge pull request #1 from redmatrix/master
merge branches
Diffstat (limited to 'library/Smarty/libs/plugins/shared.make_timestamp.php')
-rw-r--r-- | library/Smarty/libs/plugins/shared.make_timestamp.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/Smarty/libs/plugins/shared.make_timestamp.php b/library/Smarty/libs/plugins/shared.make_timestamp.php index 7c94e5f59..f87d40c7e 100644 --- a/library/Smarty/libs/plugins/shared.make_timestamp.php +++ b/library/Smarty/libs/plugins/shared.make_timestamp.php @@ -21,8 +21,8 @@ function smarty_make_timestamp($string) if (empty($string)) { // use "now": return time(); - } elseif ($string instanceof DateTime) { - return $string->getTimestamp(); + } elseif ($string instanceof DateTime || (interface_exists('DateTimeInterface', false) && $string instanceof DateTimeInterface)) { + return (int) $string->format('U'); // PHP 5.2 BC } 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), |