nerdexam
Zend

200-710 · Question #63

QUESTION 66 Given the following DateTime object, which sample will NOT alter the date to the value '2014-02-15'? $date = new DateTime('2014-03-15');

The correct answer is D. $date->diff(new DateInterval('-P1M'));. See the full explanation below for the reasoning.

Question

QUESTION 66 Given the following DateTime object, which sample will NOT alter the date to the value '2014-02-15'? $date = new DateTime('2014-03-15');

Options

  • A$date->sub(new DateInterval('P1M'));
  • B$date->setDate(2014, 2, 15);
  • C$date->modify('-1 month');
  • D$date->diff(new DateInterval('-P1M'));

How the community answered

(25 responses)
  • A
    12% (3)
  • B
    4% (1)
  • C
    4% (1)
  • D
    80% (20)

Community Discussion

No community discussion yet for this question.

Full 200-710 Practice