date("Ymd", mktime(0,0,0,date("d"),date("m")-14,date("Y")));
At 03:57 PM 2/13/01 -0500, Don wrote:
>Does someone have a snippet of code that retrieves today's date,
>subtracts 14 days and converts the result to a string in the form
>"MMDD"?
>
>If possible, please reply to my email.
>
>Thanks,
try something like :
function pastDate($days,$format='Ymd')
{
$secs = ( $days * 86400 );
return date( $format,time()-$secs );
}
print pastDate(14);
Regards,
Philip Olson
http://www.cornado.com/
On Tue, 13 Feb 2001, Don wrote:
> Does someone have a snippet of code that retrieves to
$date = getdate();
$date['mday'] -= 14;
$date = getdate(mktime($date['hours'], $date['minutes'], $date['seconds'],
$date['mon'], $date['mday'], $date['year']));
echo $date['year'];
echo $date['mon'];
echo $date['mday'];
--
Chris Lee
Mediawaveonline.com
em. [EMAIL PROTECTED]
ph. 250.37
Don wrote:
>
> Does someone have a snippet of code that retrieves today's date,
> subtracts 14 days and converts the result to a string in the form
> "MMDD"?
See http://php.net/mktime and http://php.net/date
-Egon
--
SIX Offene Systeme GmbH ·Stuttgart - Berlin
Sielminger
Does someone have a snippet of code that retrieves today's date,
subtracts 14 days and converts the result to a string in the form
"MMDD"?
If possible, please reply to my email.
Thanks,
Don
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For add
5 matches
Mail list logo