PHP Date/Time
- What will be the output of the following PHP code? If say date is 12/02/2019.
<?php
printf( date("t") )
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
The t parameter is used to determine the number of days in the current month.
- Which one of the following function is useful for producing a timestamp based on a given date and time.
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
mktime()
- Which function displays the web page’s most recent modification date?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
The getlastmod() function returns the value of the page’s Last Modified header or FALSE in the case of an error.
- What will be the output of the following code? If say date is 30/05/2018.
<?php
echo "Today is ".date("F d, Y")
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
F is the parameter for complete text representation of month, d for day of month, and Y for 4 digit representation of year.
- Say you want to calculate the date 65 days from the present date which one of the following statement will you use?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
The strtotime() function and GNU date syntax is used to calculating the date x days from the present date.