Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to use strtotime() Function in PHP ?

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 119
    Comment on it

    The strtotime() function parses an English textual datetime into a Unix timestamps
    (the number of seconds since January 1 1970 00:00:00 GMT).

    Syntax of strtotime() Function

    strtotime(time,now); 

    you can see belloe example:

    <?php
    //here call strtotime()  to print  current time
    echo(strtotime("now") . "<br>");
    //here call strtotime()  to print next Friday
    echo(strtotime("next Friday") . "<br>");
    //here call strtotime()  to print last Saturday
    echo(strtotime("last Saturday"));
    ?>
    

    output will come following:

    1448590329
    1449183600
    1448060400

 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: