03302005 1516 GMT-6

Put this script in a page and play with it.

<?php
    $date = date('mdY'); // current date of today
    $month = date('m');  // current month
    $day = date('d');    // current day   
    $year = date('Y');   // current year
    $minus = 15;         // minus 15 days

    echo $date;
    echo "<br />";
   
    echo date("M-d-Y", mktime(0,0,0, $month, $day, $year));       
        //a different way to write it

        // this is the current date minus fifteen days
    echo date("M-d-Y", mktime(0,0,0, $month, ($day-$minus), $year));
  
?>


Now, what you can do is this: Take your date from your db and assign it 
to a variable ($minusDate) and then subtract it. You just need to know 
how many days you are talking about total. You can even do hundreds of 
days.

Wade

PS. You only need the last line for your use.




ziajea wrote:

>
> Thanks Wade,
> Actually I want to find out the Difference in days between two dates.
> One date is stored in Database and another is SYSDATE.
> But I don't know how to write script in PHP/MYSQL.
> Plz write script for
>
> Difference=(Due Date - Return Date);
> I shall b thankfull.
>
>
>
>
>
>
> Community email addresses:
>   Post message: [email protected]
>   Subscribe:    [EMAIL PROTECTED]
>   Unsubscribe:  [EMAIL PROTECTED]
>   List owner:   [EMAIL PROTECTED]
>
> Shortcut URL to this page:
>   http://groups.yahoo.com/group/php-list
>
>
> *Yahoo! Groups Sponsor*
> ADVERTISEMENT
> click here 
> <http://us.ard.yahoo.com/SIG=129pgilmo/M=298184.6018725.7038619.3001176/D=groups/S=1705005703:HM/EXP=1112300752/A=2593423/R=0/SIG=11el9gslf/*http://www.netflix.com/Default?mqso=60190075>
>  
>
>
>
> ------------------------------------------------------------------------
> *Yahoo! Groups Links*
>
>     * To visit your group on the web, go to:
>       http://groups.yahoo.com/group/php-list/
>        
>     * To unsubscribe from this group, send an email to:
>       [EMAIL PROTECTED]
>       <mailto:[EMAIL PROTECTED]>
>        
>     * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>       Service <http://docs.yahoo.com/info/terms/>.
>
>
>------------------------------------------------------------------------
>
>No virus found in this incoming message.
>Checked by AVG Anti-Virus.
>Version: 7.0.308 / Virus Database: 266.8.6 - Release Date: 3/30/2005
>  
>


[Non-text portions of this message have been removed]



Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to