10 * Function: smarty_make_timestamp<br>
11 * Purpose: used by other smarty functions to make a timestamp
16 function smarty_make_timestamp($string)
21 $time = strtotime($string);
22 if (is_numeric($time) && $time != -1)
25 // is mysql timestamp format of YYYYMMDDHHMMSS?
26 if (preg_match('/^\d{14}$/', $string)) {
27 $time = mktime(substr($string,8,2),substr($string,10,2),substr($string,12,2),
28 substr($string,4,2),substr($string,6,2),substr($string,0,4));
33 // couldn't recognize it, try to return a time
34 $time = (int) $string;
41 /* vim: set expandtab: */