10 * Function: smarty_make_timestamp<br>
11 * Purpose: used by other smarty functions to make a timestamp
16 function smarty_make_timestamp($string)
22 } elseif (preg_match('/^\d{14}$/', $string)) {
23 // it is mysql timestamp format of YYYYMMDDHHMMSS?
24 $time = mktime(substr($string, 8, 2),substr($string, 10, 2),substr($string, 12, 2),
25 substr($string, 4, 2),substr($string, 6, 2),substr($string, 0, 4));
27 } elseif (is_numeric($string)) {
28 // it is a numeric string, we handle it as timestamp
32 // strtotime should handle it
33 $time = strtotime($string);
34 if ($time == -1 ||
$time === false) {
35 // strtotime() was not able to parse $string, use "now":
43 /* vim: set expandtab: */
This page took 0.254714 seconds and 4 git commands to generate.