Q14
Which of the following is the right way to use the DateTime class?
A.
$date = get_Class(DateTime);
B.
$date = class DateTime;
C.
$date = new DateTime();
AnswerD.
$date = new class DateTime();
Answer: Option C
Solution
Answer: Option C
Solution:
The way you use the DateTime class is like any other class: instantiate an object, and store it in a variable.