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