summaryrefslogtreecommitdiff
path: root/it.class
diff options
context:
space:
mode:
authorNathan Gass2011-10-28 13:13:23 +0000
committerNathan Gass2011-10-28 13:13:23 +0000
commita84fe3f02c9ff31802b683c30bf52253adc569b1 (patch)
treebe0df62294c130a66e5952dcf4ab4003d08da5da /it.class
parentb3b1362596fd721f0bedcf266bb39948ca1831c8 (diff)
downloaditools-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.class5
1 files changed, 4 insertions, 1 deletions
diff --git a/it.class b/it.class
index 3f9ccf0..bc5e94e 100644
--- a/it.class
+++ b/it.class
@@ -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);