summaryrefslogtreecommitdiff
path: root/framework/I18N/core/DateFormat.php
diff options
context:
space:
mode:
authorxue <>2006-11-25 20:51:43 +0000
committerxue <>2006-11-25 20:51:43 +0000
commitcb0aeb81d77d7170196f1b667978f56c6018100b (patch)
tree53deb6628356454d7e4348641135c84c1a909292 /framework/I18N/core/DateFormat.php
parentaf340f68ef716b9a3c021a8cabc40068068bf3bf (diff)
merge from 3.0 branch till 1508.
Diffstat (limited to 'framework/I18N/core/DateFormat.php')
-rw-r--r--framework/I18N/core/DateFormat.php8
1 files changed, 6 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);