PHP Date/Time
- Which method enables you to calculate whether daylight saving time is in force at a specific date and time?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
This outputs a multidimensional array listing past and future changes to the offset from UTC for a DateTimeZone object.
- How many methods does the DateTime class have?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
The DateTime class has nine methods, all of which are public.
- How many constants does the DateTime class have?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
The DateTime class has 11 constants, no static properties or methods.
- Which method is simply an object-oriented version of date()?
-
View Hint View Answer Discuss in Forum
NA
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.
- Which of the following is the right way to use the DateTime class?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
he way you use the DateTime class is like any other class: instantiate an object, and store it in a variable.