Home / CSE / PHP - CS :: Date and Timestamp

CSE :: PHP - CS

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

  2. A.

     Option 1 and 5

    B.

     Option 2 and 4

    C.

     Option 1 and 4

    D.

     Option 2 and 4

    View Answer

    Workspace

    Discuss Discuss in Forum


  3. The getdate() function returns

  4. A.

     An integer

    B.

     A floating-point number

    C.

     An array

    D.

     A string

    E.

     A Boolean

    View Answer

    Workspace

    Discuss Discuss in Forum


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

  6. A.

     datesunrise()

    B.

     date_sunrise()

    C.

     date-sunrise()

    D.

     date.sunrise()

    View Answer

    Workspace

    Discuss Discuss in Forum


  7. What will the following script output?

    <?php

    $time = strtotime ('2004/01/01');

    echo date ('H:i:s', $time);

    ?>

  8. A.

     0:00:00

    B.

     12:00:00

    C.

     00:i:00

    D.

     12:i:00

    E.

     -1

    View Answer

    Workspace

    Discuss Discuss in Forum


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

  10. A.

     check_date

    B.

     verifydate

    C.

     Verify_date

    D.

     checkdate

    View Answer

    Workspace

    Discuss Discuss in Forum


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

  12. 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

    View Answer

    Workspace

    Discuss Discuss in Forum


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

  14. A.

     date_default_timezone_set()

    B.

     datedefault_timezone_set()

    C.

     date_defaulttimezone_set()

    D.

     date_default_timezoneset()

    View Answer

    Workspace

    Discuss Discuss in Forum


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

    <?php

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

    ?>

  16. 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

    View Answer

    Workspace

    Discuss Discuss in Forum


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

  18. A.

     strtodate()

    B.

     stroftime()

    C.

     strtotime()

    D.

     str_to_time()

    View Answer

    Workspace

    Discuss Discuss in Forum


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

  20. A.

     strftime

    B.

     strgtime

    C.

     strhtime

    D.

     stritime

    View Answer

    Workspace

    Discuss Discuss in Forum