Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • PHP date_add() Function ?

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 719
    Comment on it

    The date_add() function is mainly used for adding some days, months, years, hours, minutes, and seconds to a date.

    Syntax of date_add()

    date_add(object,interval);

    you can take belloe example for better understanding:

    <?php
    //here define a date variable 
    $date=date_create("2015-08-01");
    //here call date_add function and define interval days and months
    date_add($date,date_interval_create_from_date_string("30 days"));
    //print date format
    echo date_format($date,"Y-m-d");
    ?>
    

    output will come following:

    2015-08-31

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: