sfTime::subtract
Subtracts the specified number of given units of time from the given date.
<b>Example:</b> <code> // yesterday $dt = sfTime::subtract(); // day before $dt = sfTime::subtract($mydate); // 5 days before $dt = sfTime::subtract($mydate, 5); // 2 months before $dt = sfTime::subtract($mydate, 2, sfTime::MONTH); // 4 weeks before $dt = sfTime::subtract($mydate, 4, sfTime::WEEK); </code>
Signature
public function subtract([
$ts = NULL,
[integer
$num = 1,
[
$unit = sfTime::DAY]]] )
Parameters
$ts
—$num
— integer$unit
—
Returns
- timestamp
- the timestamp result of the calculation