note 101192 deleted from function.date by tularis
| From: | tularis@php.net | Date: | Thu, 09 Feb 2012 20:52:40 +0000 |
| Subject: | note 101192 deleted from function.date by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-185965@lists.php.net to get a copy of this message | ||
Note Submitter: neemias dot godinho at yahoo dot com dot br
----
this function returns the current date of server subtracted from a number of days passed as
parameter
<?php
function subtractDaysFromToday($number_of_days)
{
$today = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
$subtract = $today - (86400 * $number_of_days);
//choice a date format here
return date("Y-m-d", $subtract);
}
?>