Loading...
PHP

Date and Time Functions of PHP

By these functions we get the current dates time information as time stamp. It returns output in the form of times stamp value.

  1. Times Stamp: It returns total number of seconds since UNIX epoch i.e, 1st January 1970 to the current time.
    <?php
    echo time();
    ?>
  2. Date: This function is used to convert times stamp value as date, month and year format string.
    <?php
    echo date(‘d,m,y’,time());
    ?>
  3. sleep: By this function we can start execution of program to specified interval of time period.
    <?php
    echo “hi”;
    sleep(10);
    echo “Webnoid”;
    ?>
  4. check date: This is used to check input date is existed or not.
    <?php
    echo checkdate(‘2′,28′,’2020’);
    ?>
Leave a Reply

Your email address will not be published. Required fields are marked *