Easier way to do that is like so:

$archive_date = date("Y-m-d", (time()-(86400*90)));

I use this same kind of calculation for getting a date in the future.
86400 is the number of seconds in a day. Time returns the Unix
Timestamp, just like you would get with mktime(). Makes for a lot less
code and you don't need a function to do it. Hope this helps.

Jami Moore
LightSPARK Digital Designs
[EMAIL PROTECTED]
http://www.lightsparkdigital.com/


>> -----Original Message-----
>> From: [EMAIL PROTECTED] 
>> 
>> 
>> Got this function...
>> I wanna remove 90 days from todays date, giving a final 
>> date, in the same 
>> format as the original, that counts back 90 days...
>> My code is below, and if anyone would like to offer advse, I 
>> welcome it...
>> 
>> =======================
>> $today = date("Y-m-d");
>> function minus90($calc){
>>    $year = substr($today, 0, 4);
>>    $month = substr($today, 5, -3);
>>    $day = substr($today, 8, 10);
>>    $timestamp = mktime (0,0,0,$month,$day,$year);
>>    return strftime ("%Y-%m-%d", $timestamp);
>> }
>> $archive_date = minus90($today);
>> 
>> 
>> echo $archive_date;
>> ==========================

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to