Home » PHP » PHP Date/Time » Question
  1. Which method is simply an object-oriented version of date()?
    1. DateTime::setDate()
    2. DateTime::setTime()
    3. DateTime::format()
    4. DateTime::modify()
    5. None of these
Correct Option: C

The format() method is simply an object-oriented version of date(). It takes $dateFormat as an argument. $dateFormat is a string consisting of the same date formatting characters accepted by the procedural date() function.



Your comments will be displayed only after manual approval.