Which of the following samples will correctly return a date in the format ‘2017-01-01 00:00:01’?

Given a DateTime object that is set to the first second of the year 2017, which of the following samples will correctly return a date in the format ‘2017-01-01 00:00:01’?
A. $datetime->format(‘%Y-%m-%d %h:%i:%s’)
B. $datetime->format(‘%Y-%m-%d %h:%i:%s’, array(‘year’, ‘month’, ‘day’, ‘hour’, ‘minute’, ‘second’))
C. $datetime->format(‘Y-m-d H:i:s’)
D. $date = date(“Y-m-d H:i:s’, $datetime);

Download Printable PDF. VALID exam to help you PASS.

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.