Home » PHP » PHP Date/Time » Question
  1. What will be the output of the following PHP code if date is 15/03/2019?
    <?php
    $date = new DateTime();
    echo $date->format('l,F,js,Y')
    ?>
    1. Friday,March,15th 2019
    2. Sunday, 15 03 2019
    3. Saturday, 15th March 2019
    4. Friday, 15/03, 2019
    5. None of these
Correct Option: A

The format() method displays the date in same way as standard date function().



Your comments will be displayed only after manual approval.