summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorwei <>2006-11-19 00:18:00 +0000
committerwei <>2006-11-19 00:18:00 +0000
commit415625e02d5661588a18ac21b789bc0107bd1761 (patch)
treea9ce3155d59985f08b46a33f6acfea611483c011 /framework
parente2b765792fd664cc45c2cc9f686f2b4988b80148 (diff)
Fix #453
Diffstat (limited to 'framework')
-rw-r--r--framework/I18N/core/DateFormat.php8
-rw-r--r--framework/Util/TDateTimeStamp.php2
2 files changed, 8 insertions, 2 deletions
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);
diff --git a/framework/Util/TDateTimeStamp.php b/framework/Util/TDateTimeStamp.php
index 9949b837..ab49470f 100644
--- a/framework/Util/TDateTimeStamp.php
+++ b/framework/Util/TDateTimeStamp.php
@@ -194,6 +194,8 @@ class TDateTimeStamp
return $this->_getDateInternal($d);
}
+
+
/**
* Low-level function that returns the getdate() array. We have a special
* $fast flag, which if set to true, will return fewer array values,