Sail E0 Webinar

MCQs

Total Questions : 30 | Page 2 of 3 pages
Question 11. How many methods does the DateTime class have?
  1.    10
  2.    8
  3.    11
  4.    9
 Discuss Question
Answer: Option D. -> 9
Question 12. Which method is simply an object-oriented version of date()?
  1.    DateTime::modify()
  2.    DateTime::format()
  3.    DateTime::setTime()
  4.    DateTime::setDate()
 Discuss Question
Answer: Option B. -> DateTime::format()
Question 13. What will be the output of the following PHP code if date is 24/02/2008?$date = new DateTime();echo $date->format('l,F,js,Y')
  1.    Sunday, 02 24 2008
  2.    Sunday, February 24th 2008
  3.    Sunday, 24 02 2008
  4.    Sunday, 24th February 2008
 Discuss Question
Answer: Option B. -> Sunday, February 24th 2008
Question 14. Which of the following is the right way to use the DateTime class?
  1.    $date = new class DateTime();
  2.    $date = get_Class(DateTime);
  3.    $date = new DateTime();
  4.    $date = class DateTime;
 Discuss Question
Answer: Option C. -> $date = new DateTime();
Question 15. How many constants does the DateTime class have?
  1.    10
  2.    11
  3.    8
  4.    9
 Discuss Question
Answer: Option B. -> 11
Question 16. Which of the following statements can be used to add two months to the existing date?
  1.    $date = modify(‘+2 months’);
  2.    $date = modify(‘2+ months’);
  3.    $date->modify(‘2+ months’);
  4.    $date->modify(‘+2 months’);
 Discuss Question
Answer: Option D. -> $date->modify(‘+2 months’);
Question 17. Which method enables you to calculate whether daylight saving time is in force at a specific date and time?
  1.    savingTime()
  2.    getTranitions()
  3.    getOffset()
  4.    ISODate()
 Discuss Question
Answer: Option B. -> getTranitions()
Question 18. Which of the following statements can be used to set the time zone in individual scripts?
  1.    date_set_default_timezone(‘Europe/London’);
  2.    date_default_timezone_set(‘Europe/London’);
  3.    date_default_timezone(‘Europe/London’);
  4.    date_set_timezone(‘Europe/London’);
 Discuss Question
Answer: Option B. -> date_default_timezone_set(‘Europe/London’);
Question 19. Among the four PHP DateTimeZone classes given below how many are nonstatic?1. _construct()2. getName()3. getOffset()4. getTransitions()
  1.    1
  2.    3
  3.    4
  4.    2
 Discuss Question
Answer: Option C. -> 4
Question 20. Among the four PHP DateTimeZone classes given below how many are static?1. listAbbreviations()2. getName()3. getOffset()4. listIdentifiers()
  1.    4
  2.    2
  3.    3
  4.    1
 Discuss Question
Answer: Option B. -> 2

Latest Videos

Latest Test Papers