diff options
author | Urban Müller | 2014-07-31 14:48:56 +0200 |
---|---|---|
committer | Urban Müller | 2014-07-31 14:48:56 +0200 |
commit | 6688ddbd65983239d28ea8b1da5e70030ae88c6f (patch) | |
tree | a9e5a7f8b3551eacc8e31746eef1e583dc3ee65c /it.class | |
parent | 4913c5d128abe3987bb16e462dad6543bf522f63 (diff) | |
download | itools-6688ddbd65983239d28ea8b1da5e70030ae88c6f.tar.gz itools-6688ddbd65983239d28ea8b1da5e70030ae88c6f.tar.bz2 itools-6688ddbd65983239d28ea8b1da5e70030ae88c6f.zip |
support it::time
Diffstat (limited to 'it.class')
-rw-r--r-- | it.class | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -859,6 +859,14 @@ static function gets() } /** + * 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). * Other formats are "date", "datetime", "time". @@ -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); |