diff options
author | Nathan Gass | 2011-10-28 13:13:23 +0000 |
---|---|---|
committer | Nathan Gass | 2011-10-28 13:13:23 +0000 |
commit | a84fe3f02c9ff31802b683c30bf52253adc569b1 (patch) | |
tree | be0df62294c130a66e5952dcf4ab4003d08da5da /it.class | |
parent | b3b1362596fd721f0bedcf266bb39948ca1831c8 (diff) | |
download | itools-a84fe3f02c9ff31802b683c30bf52253adc569b1.tar.gz itools-a84fe3f02c9ff31802b683c30bf52253adc569b1.tar.bz2 itools-a84fe3f02c9ff31802b683c30bf52253adc569b1.zip |
avoid it::match in it::date for *2 speedup
Diffstat (limited to 'it.class')
-rw-r--r-- | it.class | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -723,7 +723,10 @@ static function gets() */ static function date($format = "", $stamp = null) { - $stamp = !isset($stamp) ? time() : (it::match('^\d+$', $stamp) ? $stamp : strtotime($stamp)); + if (!isset($stamp)) + $stamp = time(); + else if(!is_int($stamp) && !ctype_digit($stamp) && (!is_float($stamp) || strstr($stamp, '.'))) + $stamp = strtotime($stamp); list($name, $language) = explode(":", $format); |