-
Which of the following is the right way to use the DateTime class?
-
- $date = new class DateTime();
- $date = new DateTime();
- $date = class DateTime;
- $date = get_Class(DateTime);
- None of these
Correct Option: B
he way you use the DateTime class is like any other class: instantiate an object, and store it in a variable.