PHP Date/Time


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











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    This outputs a multidimensional array listing past and future changes to the offset from UTC for a DateTimeZone object.


  1. How many methods does the DateTime class have?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    The DateTime class has nine methods, all of which are public.



  1. How many constants does the DateTime class have?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    The DateTime class has 11 constants, no static properties or methods.


  1. Which method is simply an object-oriented version of date()?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    The format() method is simply an object-oriented version of date(). It takes $dateFormat as an argument. $dateFormat is a string consisting of the same date formatting characters accepted by the procedural date() function.



  1. Which of the following is the right way to use the DateTime class?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    he way you use the DateTime class is like any other class: instantiate an object, and store it in a variable.