From f7f3d150ef35c026bf6aee72e78362e263419e1a Mon Sep 17 00:00:00 2001 From: knut <> Date: Wed, 6 Aug 2008 01:34:06 +0000 Subject: fixed #898 --- framework/Util/TDateTimeStamp.php | 10 +++++----- framework/Util/TSimpleDateFormatter.php | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'framework/Util') diff --git a/framework/Util/TDateTimeStamp.php b/framework/Util/TDateTimeStamp.php index c2fb1327..07466462 100644 --- a/framework/Util/TDateTimeStamp.php +++ b/framework/Util/TDateTimeStamp.php @@ -9,7 +9,7 @@ * * @author Wei Zhuo * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2008 PradoSoft + * @copyright Copyright © 2005-2008 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @package System.Util @@ -619,9 +619,9 @@ class TDateTimeStamp $min = intval($min); $sec = intval($sec); */ - $mon = intval($mon); - $day = intval($day); - $year = intval($year); + $mon = (int)$mon; + $day = (int)$day; + $year = (int)$year; $year = $this->digitCheck($year); @@ -700,4 +700,4 @@ class TDateTimeStamp } } -?> +?> diff --git a/framework/Util/TSimpleDateFormatter.php b/framework/Util/TSimpleDateFormatter.php index d0ed4496..07a59398 100644 --- a/framework/Util/TSimpleDateFormatter.php +++ b/framework/Util/TSimpleDateFormatter.php @@ -261,19 +261,19 @@ class TSimpleDateFormatter $i_val += strlen($year); if(strlen($year) == 2) { - $iYear = intval($year); + $iYear = (int)$year; if($iYear > 70) $year = $iYear + 1900; else $year = $iYear + 2000; } - $year = intval($year); + $year = (int)$year; } elseif($token=='MM' || $token=='M') { $month=$this->getInteger($value,$i_val, $this->length($token),2); - $iMonth = intval($month); + $iMonth = (int)$month; if($month === null || $iMonth < 1 || $iMonth > 12 ) return null; //throw new TInvalidDataValueException('Invalid month', $value); @@ -284,7 +284,7 @@ class TSimpleDateFormatter { $day = $this->getInteger($value,$i_val, $this->length($token), 2); - $iDay = intval($day); + $iDay = (int)$day; if($day === null || $iDay < 1 || $iDay >31) return null; //throw new TInvalidDataValueException('Invalid day', $value); -- cgit v1.2.3