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

CSE :: PHP - CS

  1. What will be the output of the following PHP code?

    <?php

    echo (checkdate(4,31,2010) ? 'Valid' : 'Invalid');

    ?>

  2. A.

     TRUE

    B.

     FALSE

    C.

     Valid

    D.

     Invalid

    View Answer

    Workspace

    Discuss Discuss in Forum


  3. The date() function returns ___ representation of the current date and/or time.

  4. A.

     Integer

    B.

     String

    C.

     Boolean

    D.

     Float

    View Answer

    Workspace

    Discuss Discuss in Forum


  5. Which one of the following format parameter can be used to identify timezone?

  6. A.

     T

    B.

     N

    C.

     E

    D.

     I

    View Answer

    Workspace

    Discuss Discuss in Forum


  7. If the format is F then which one of the following will be returned?

  8. A.

     Complete text representation of month

    B.

     Day of month, with leading zero

    C.

     Daylight saving time

    D.

     Day of month, without zeros

    View Answer

    Workspace

    Discuss Discuss in Forum


  9. What will be the output of the following code? If say date is 22/06/2013.

    <?php

    echo "Today is ".date("F d, Y")

    ?>

  10. A.

     Today is 22 June, 2013

    B.

     Today is 22-06-2013

    C.

     Today is 06-22-2013

    D.

     Today is June 22, 2013

    View Answer

    Workspace

    Discuss Discuss in Forum


  11. Which one of the following function is useful for producing a timestamp based on a given date and time.

  12. A.

     time()

    B.

     mktime()

    C.

     mrtime()

    D.

     mtime()

    View Answer

    Workspace

    Discuss Discuss in Forum


  13. Which function displays the web page’s most recent modification date?

  14. A.

     lastmod()

    B.

     getlastmod()

    C.

     last_mod()

    D.

     get_last_mod()

    View Answer

    Workspace

    Discuss Discuss in Forum


  15. What will be the output of the following PHP code? If say date is 22/06/2013.

    <?php

    printf( date("t") )

    ?>

  16. A.

     30

    B.

     22

    C.

     JUNE

    D.

     2013

    View Answer

    Workspace

    Discuss Discuss in Forum


  17. Say you want to calculate the date 45 days from the present date which one of the following statement will you use?

  18. A.

     totime(“+45”)

    B.

     totime(“+45 days”)

    C.

     strtotime(“+45 days”)

    D.

     strtotime(“-45 days”)

    View Answer

    Workspace

    Discuss Discuss in Forum


  19. To create an object and set the date to JUNE 22, 2013, which one of the following statement should be executed?

  20. A.

     $date = Date(“22 JUNE 2013”)

    B.

     $date = new Date(“JUNE 22 2013”)

    C.

     $date = DateTime(“22 JUNE 2013”)

    D.

     $date = new DateTime(“22 JUNE 2013”)

    View Answer

    Workspace

    Discuss Discuss in Forum