From a84fe3f02c9ff31802b683c30bf52253adc569b1 Mon Sep 17 00:00:00 2001 From: Nathan Gass Date: Fri, 28 Oct 2011 13:13:23 +0000 Subject: avoid it::match in it::date for *2 speedup --- it.class | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3