From 415625e02d5661588a18ac21b789bc0107bd1761 Mon Sep 17 00:00:00 2001 From: wei <> Date: Sun, 19 Nov 2006 00:18:00 +0000 Subject: Fix #453 --- framework/I18N/core/DateFormat.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'framework/I18N/core/DateFormat.php') diff --git a/framework/I18N/core/DateFormat.php b/framework/I18N/core/DateFormat.php index 142926f4..8dd3fdca 100644 --- a/framework/I18N/core/DateFormat.php +++ b/framework/I18N/core/DateFormat.php @@ -110,13 +110,17 @@ class DateFormat */ public function format($time, $pattern='F', $charset='UTF-8') { - if(is_string($time)) + if (is_numeric($time)) //assumes unix epoch + $time = floatval($time); + else if(is_string($time)) $time = @strtotime($time); if(is_null($pattern)) $pattern = 'F'; - $date = @getdate($time); + $s = Prado::createComponent('System.Util.TDateTimeStamp'); + + $date = $s->getDate($time); $pattern = $this->getPattern($pattern); -- cgit v1.2.3