PHP Date-Time Multiple Choice Questions

Which of the following functions do not return a timestamp?

A) time()
B) date()
C) strtotime()
D) localtime()
E) gmmktime()

The getdate() function returns

A) An integer
B) A floating-point number
C) An array
D) A string
E) A Boolean

.......... Returns the time of sunrise for a given day / location

A) datesunrise()
B) date_sunrise()
C) date-sunrise()
D) date.sunrise()

What will the following script output?

$time = strtotime ('2004/01/01');
echo date ('H:\i:s', $time);

A) 00:00:00
B) 12:00:00
C) 00:i:00
D) 12:i:00
E) -1

................Checks a date for numeric validity.

A) check_date
B) verifydate
C) Verify_date
D) checkdate

What is the difference, in seconds, between the current timestamp in the GMT time zone and the current timestamp in your local time zone?

A) It depends on the number of hours between the local time zone and GMT
B) There is no difference
C) The two will only match if the local time zone is GMT
D) The two will never match
E) None of the above

You must make a call to ................... to specify what time zone you want calculations to take place in before calling any date functions.

A) date_default_timezone_set()
B) datedefault_timezone_set()
C) date_defaulttimezone_set()
D) date_default_timezoneset()

What would happen if the following script were run on a Windows server set to Moscow, Russia’s time zone?

echo gmmktime(0, 0, 0, 1, 1, 1970);

A) It would output the number 0
B) It would output the number -1
C) It would output the number 1
D) It would raise an error
E) It would output nothing

The ......... function parses an English textual date or time into a Unix timestamp

A) strtodate()
B) stroftime()
C) strtotime()
D) str_to_time()

................ Formats a local time or date according to locale settings.

A) strftime
B) strgtime
C) strhtime
D) stritime