Computer

Date And Timestamp MCQs

Practice Date And Timestamp MCQs for competitive exams.

Date And Timestamp MCQs

Practice questions from this topic.

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

  1. A. strftime
  2. B. strgtime
  3. C. strhtime
  4. D. stritime
Report Error

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

  1. A. strtodate()
  2. B. stroftime()
  3. C. strtotime()
  4. D. str_to_time()
Report Error

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

  1. A. It would output the number 0
  2. B. It would output the number -1
  3. C. It would output the number 1
  4. D. It would raise an error E. It would output nothing
Report Error

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

  1. A. date_default_timezone_set()
  2. B. datedefault_timezone_set()
  3. C. date_defaulttimezone_set()
  4. D. date_default_timezoneset()
Report Error

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

  1. A. It depends on the number of hours between the local time zone and GMT
  2. B. There is no difference
  3. C. The two will only match if the local time zone is GMT
  4. D. The two will never match E. None of the above
Report Error

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

  1. A. check_date
  2. B. verifydate
  3. C. Verify_date
  4. D. checkdate
Report Error

What will the following script output?

  1. A. 0:00:00
  2. B. 12:00:00
  3. C. 00:i:00
  4. D. 12:i:00 E. -1
Report Error

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

  1. A. datesunrise()
  2. B. date_sunrise()
  3. C. date-sunrise()
  4. D. date.sunrise()
Report Error

The getdate() function returns

  1. A. An integer
  2. B. A floating-point number
  3. C. An array
  4. D. A string E. A Boolean
Report Error

Which of the following functions do not return a timestamp? 1. time() 2. date() 3. strtotime() 4. localtime() 5. gmmktime()

  1. A. Option 1 and 5
  2. B. Option 3 and 4
  3. C. Option 1 and 4
  4. D. Option 2 and 4
Report Error

Which method enables you to calculate whether daylight saving time is in force at a specific date and time?

  1. A. getOffset()
  2. B. getTranitions()
  3. C. ISODate()
  4. D. savingTime()
Report Error

Which of the following statements can be used to add two months to the existing date?

  1. A. $date->modify(‘+2 months’)
  2. B. $date = modify(‘+2 months’)
  3. C. $date = modify(‘2+ months’)
  4. D. $date->modify(‘2+ months’)
Report Error