Vidyalelo
PHP · Q13

Date And Timestamp

Programming · PHP · question 13

Q13

Which method is simply an object-oriented version of date()?

A.
DateTime::format()
Answer
B.
DateTime::modify()
C.
DateTime::setTime()
D.
DateTime::setDate()

Answer: Option A

Solution

Answer: Option A
Solution:
The format() method is simply an object-oriented version of date(). It takes dateFormat is a string consisting of the same date formatting characters accepted by the procedural date() function.