From 6688ddbd65983239d28ea8b1da5e70030ae88c6f Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Thu, 31 Jul 2014 14:48:56 +0200 Subject: support it::time --- it.class | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'it.class') diff --git a/it.class b/it.class index 64a2f51..f514537 100644 --- a/it.class +++ b/it.class @@ -858,6 +858,14 @@ static function gets() return $result; } +/** + * Like time() but overridable via debug param + */ +function time() +{ + return ($t = EDC('time')) ? strtotime($t) : time(); +} + /** * Output formatted and localized date * @param format optional format (default is 2007-01-02 03:04:05). @@ -870,9 +878,9 @@ static function gets() static function date($format = "", $stamp = null) { if (!isset($stamp)) - $stamp = EDC('time') ? strtotime(EDC('time')) : time(); + $stamp = it::time(); else if (is_string($stamp) && !ctype_digit($stamp)) - $stamp = strtotime($stamp); + $stamp = strtotime($stamp, it::time()); list($name, $language) = explode(":", $format); -- cgit v1.2.3