public static function add($ts = null, $num = 1, $unit = sfTime::DAY)
	{
		// default to now
		if ($ts === null) $ts = sfDateTimeToolkit::now();
		
		// gather individual variables for readability and maintainability
		list($H, $i, $s, $m, $d, $Y) = sfDateTimeToolkit::breakdown($ts);
		
		// determine which unit of time to add by
		switch ($unit)
		{
			case sfTime::SECOND:
				return mktime($H, $i, $s + $num, $m, $d, $Y);
			case sfTime::MINUTE:
				return mktime($H, $i + $num, $s, $m, $d, $Y);
			case sfTime::HOUR:
				return mktime($H + $num, $i, $s, $m, $d, $Y);
			case sfTime::DAY:
				return mktime($H, $i, $s, $m, $d + $num, $Y);
			case sfTime::WEEK:
				return mktime($H, $i, $s, $m, $d + (7 * $num), $Y);
			case sfTime::MONTH:
				return mktime($H, $i, $s, $m + $num, $d, $Y);
			case sfTime::QUARTER:
				return mktime($H, $i, $s, $m + (3 * $num), $d, $Y);
			case sfTime::YEAR:
				return mktime($H, $i, $s, $m, $d, $Y + $num);
			case sfTime::DECADE:
				return mktime($H, $i, $s, $m, $d, $Y + (10 * $num));
			case sfTime::CENTURY:
				return mktime($H, $i, $s, $m, $d, $Y + (100 * $num));
			case sfTime::MILLENIUM:
				return mktime($H, $i, $s, $m, $d, $Y + (1000 * $num));
			default:
				throw new sfDateTimeException(sprintf('The unit of time provided is not valid: %s', $unit));
		}
	}
public static function add($ts = null, $num = 1, $unit = sfTime::DAY)
	{
		// default to now
		if ($ts === null) $ts = sfDateTimeToolkit::now();
		
		// gather individual variables for readability and maintainability
		list($H, $i, $s, $m, $d, $Y) = sfDateTimeToolkit::breakdown($ts);
		
		// determine which unit of time to add by
		switch ($unit)
		{
			case sfTime::SECOND:
				return mktime($H, $i, $s + $num, $m, $d, $Y);
			case sfTime::MINUTE:
				return mktime($H, $i + $num, $s, $m, $d, $Y);
			case sfTime::HOUR:
				return mktime($H + $num, $i, $s, $m, $d, $Y);
			case sfTime::DAY:
				return mktime($H, $i, $s, $m, $d + $num, $Y);
			case sfTime::WEEK:
				return mktime($H, $i, $s, $m, $d + (7 * $num), $Y);
			case sfTime::MONTH:
				return mktime($H, $i, $s, $m + $num, $d, $Y);
			case sfTime::QUARTER:
				return mktime($H, $i, $s, $m + (3 * $num), $d, $Y);
			case sfTime::YEAR:
				return mktime($H, $i, $s, $m, $d, $Y + $num);
			case sfTime::DECADE:
				return mktime($H, $i, $s, $m, $d, $Y + (10 * $num));
			case sfTime::CENTURY:
				return mktime($H, $i, $s, $m, $d, $Y + (100 * $num));
			case sfTime::MILLENIUM:
				return mktime($H, $i, $s, $m, $d, $Y + (1000 * $num));
			default:
				throw new sfDateTimeException(sprintf('The unit of time provided is not valid: %s', $unit));
		}
	}
public static function add ( $ ts = null , $ num = 1 , $ unit = sfTime :: DAY ) { // default to now if ( $ ts === null ) $ ts = sfDateTimeToolkit :: now ( ) ; // gather individual variables for readability and maintainability list ( $ H , $ i , $ s , $ m , $ d , $ Y ) = sfDateTimeToolkit :: breakdown ( $ ts ) ; // determine which unit of time to add by switch ( $ unit ) { case sfTime :: SECOND : return mktime ( $ H , $ i , $ s + $ num , $ m , $ d , $ Y ) ; case sfTime :: MINUTE : return mktime ( $ H , $ i + $ num , $ s , $ m , $ d , $ Y ) ; case sfTime :: HOUR : return mktime ( $ H + $ num , $ i , $ s , $ m , $ d , $ Y ) ; case sfTime :: DAY : return mktime ( $ H , $ i , $ s , $ m , $ d + $ num , $ Y ) ; case sfTime :: WEEK : return mktime ( $ H , $ i , $ s , $ m , $ d + ( 7 * $ num ) , $ Y ) ; case sfTime :: MONTH : return mktime ( $ H , $ i , $ s , $ m + $ num , $ d , $ Y ) ; case sfTime :: QUARTER : return mktime ( $ H , $ i , $ s , $ m + ( 3 * $ num ) , $ d , $ Y ) ; case sfTime :: YEAR : return mktime ( $ H , $ i , $ s , $ m , $ d , $ Y + $ num ) ; case sfTime :: DECADE : return mktime ( $ H , $ i , $ s , $ m , $ d , $ Y + ( 10 * $ num ) ) ; case sfTime :: CENTURY : return mktime ( $ H , $ i , $ s , $ m , $ d , $ Y + ( 100 * $ num ) ) ; case sfTime :: MILLENIUM : return mktime ( $ H , $ i , $ s , $ m , $ d , $ Y + ( 1000 * $ num ) ) ; default : throw new sfDateTimeException ( sprintf ( 'The unit of time provided is not valid: %s' , $ unit ) ) ; } }
Adds the specified number of given units of time to the given date.

<b>Example:</b>
<code>
// tomorrow
$dt = sfTime::add();
// day after
$dt = sfTime::add($mydate);
// 5 days after
$dt = sfTime::add($mydate, 5);
// 2 months after
$dt = sfTime::add($mydate, 2, sfTime::MONTH);
// 4 weeks after
$dt = sfTime::add($mydate, 4, sfTime::WEEK);
</code>

@param	timestamp	a timestamp for the calculation
@param	int			the number of units to add to the given date
@param	int			the unit to add by
@return	timestamp	the timestamp result of the calculation

@throws	sfDateTimeException
Adds the specified number of given units of time to the given date .