Zend
200-550 · Question #219
Which of the following will NOT instantiate a DateTime object with the current timestamp?
The correct answer is D. $date = new DateTime(time()). See the full explanation below for the reasoning.
Question
Which of the following will NOT instantiate a DateTime object with the current timestamp?
Options
- A$date = new DateTime();
- B$date = new DateTime('@' . time());
- C$date = new DateTime('now');
- D$date = new DateTime(time());
How the community answered
(35 responses)- A3% (1)
- B3% (1)
- C11% (4)
- D83% (29)
Community Discussion
No community discussion yet for this question.