Apply for Zend Framework Certification Training

Corephp






PHP Date() Function

HI viewers many times we have to include or print current date in php Application
so to print that date and its in different format we can use date() function
Usage description date(format,timestamp);

d - Represents the day of the month (01 to 31)

m - Represents a month (01 to 12)

Y - Represents a year (in four digits)

l (lowercase 'L') - Represents the day of the week


< ?php
    echo "Today is " . date("Y/m/d") . " ";
    echo "Today is " . date("Y.m.d") . " ";
    echo "Today is " . date("Y-m-d") . " ";
    echo "Today is " . date("l");
?>                                    

< First How to sanitize user input in PHP >



Ask a question



  • Question:
    {{questionlistdata.blog_question_description}}
    • Answer:
      {{answer.blog_answer_description  }}
    Replay to Question


Back to Top