What will be the output of the following PHP code if date is 24/02/2008?
<?php
$date = new DateTime();
echo $date->format('l,F,js,Y')
?>
<?php
$date = new DateTime();
echo $date->format('l,F,js,Y')
?>
A. Sunday, February 24th 2008
B. Sunday, 02 24 2008
C. Sunday, 24 02 2008
D. Sunday, 24th February 2008
Answer: Option A
Solution(By Examveda Team)
The format() method displays the date in same way as standard date function().Related Questions on Date and Timestamp
A. TRUE
B. FALSE
C. Valid
D. Invalid
The date() function returns ___ representation of the current date and/or time.
A. Integer
B. String
C. Boolean
D. Float
If the format is F then which one of the following will be returned?
A. Complete text representation of month
B. Day of month, with leading zero
C. Daylight saving time
D. Day of month, without zeros
Join The Discussion