Given a DateTime object that is set to the first second of the year 2014, which of the following samples will correctly return a date in the format '2014-01-01 00:00:01'?
Easy peasy, Option C is the winner. I wonder if the exam writer has a sense of humor, though. Maybe they'll throw in a trick question just to keep us on our toes.
I'm not sure, but I think D) $date = date('Y-m-d H:i:s', $datetime); might also work. It seems like it could convert the DateTime object to the correct format.
Stefania
9 days agoJanna
13 days agoRicarda
23 days agoCorinne
11 days agoKenneth
12 days agoHannah
18 days agoMose
25 days agoSusana
1 months agoMyong
2 months agoVanna
2 months ago