summaryrefslogtreecommitdiff
path: root/libs/plugins/shared.make_timestamp.php
diff options
context:
space:
mode:
authoruwetews <uwe.tews@googlemail.com>2016-02-09 01:27:15 +0100
committeruwetews <uwe.tews@googlemail.com>2016-02-09 01:27:15 +0100
commitb04486a091558a2b1280e3ee7fb90758e9a32230 (patch)
treeddb15a12dba78e6873a348acd25f872429e210d2 /libs/plugins/shared.make_timestamp.php
parentc59ca44b9ff62a7f54e30409514834a8529780ca (diff)
downloadsmarty-b04486a091558a2b1280e3ee7fb90758e9a32230.tar.gz
smarty-b04486a091558a2b1280e3ee7fb90758e9a32230.tar.bz2
smarty-b04486a091558a2b1280e3ee7fb90758e9a32230.zip
- reformat all code for unique style
Diffstat (limited to 'libs/plugins/shared.make_timestamp.php')
-rw-r--r--libs/plugins/shared.make_timestamp.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/libs/plugins/shared.make_timestamp.php b/libs/plugins/shared.make_timestamp.php
index f87d40c7..67f86244 100644
--- a/libs/plugins/shared.make_timestamp.php
+++ b/libs/plugins/shared.make_timestamp.php
@@ -21,12 +21,14 @@ function smarty_make_timestamp($string)
if (empty($string)) {
// use "now":
return time();
- } elseif ($string instanceof DateTime || (interface_exists('DateTimeInterface', false) && $string instanceof DateTimeInterface)) {
+ } 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),
- substr($string, 4, 2), substr($string, 6, 2), substr($string, 0, 4));
+ return mktime(substr($string, 8, 2), substr($string, 10, 2), substr($string, 12, 2), substr($string, 4, 2),
+ substr($string, 6, 2), substr($string, 0, 4));
} elseif (is_numeric($string)) {
// it is a numeric string, we handle it as timestamp
return (int) $string;