summaryrefslogtreecommitdiff
path: root/framework/Util/TSimpleDateFormatter.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Util/TSimpleDateFormatter.php')
-rw-r--r--framework/Util/TSimpleDateFormatter.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/framework/Util/TSimpleDateFormatter.php b/framework/Util/TSimpleDateFormatter.php
index d8bf513a..d0ed4496 100644
--- a/framework/Util/TSimpleDateFormatter.php
+++ b/framework/Util/TSimpleDateFormatter.php
@@ -4,7 +4,7 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2008 PradoSoft
+ * @copyright Copyright &copy; 2005-2008 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Util
@@ -305,9 +305,12 @@ class TSimpleDateFormatter
if(!$defaultToCurrentTime && ($month === null || $day === null || $year === null))
return null;
else
- {
- $day = intval($day) <= 0 ? 1 : intval($day);
- $month = intval($month) <= 0 ? 1 : intval($month);
+ {
+ if(empty($year)) {
+ $year = date('Y');
+ }
+ $day = (int)$day <= 0 ? 1 : (int)$day;
+ $month = (int)$month <= 0 ? 1 : (int)$month;
$s = Prado::createComponent('System.Util.TDateTimeStamp');
return $s->getTimeStamp(0, 0, 0, $month, $day, $year);
}
@@ -369,4 +372,4 @@ class TSimpleDateFormatter
}
}
-?>
+?>