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

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 148
    Comment on it

    The date() function formats a local date and time, and returns the formatted date string.

    Basically uses of The date() function formats a local date and time. The date() function returns the formatted date string.

    syntex of date () function

     date(format,timestamp);

    you can see belloe example:

     <?php
    //now call date () for printing the current  day
    echo date("l") . "<br>";
    
    
    //now call date () for printing the current day,  current time, AM or PM
    echo date("l  h:i:s A") . "<br>";
    
    
    // now call date () for printing the current day, current date,current month,current year, current time, AM or PM
    echo date("l jS \of F Y h:i:s A") . "<br>";
    
    
    ?>
    

    output will come following:
    1- When we will print date("l"), then output will come

    Friday

    2-When we will print date("l h:i:s A"), then output will come

    Friday 02:47:42 AM

    3-When we will print date("l h:i:s A"), then output will come

    Friday 27th of November 2015 02:47:42 AM

 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: