• 11Nov

    Sometimes we need to make up a timestamp to save in a database, or to compare with other dates. mktime() essentially creates the same thing that time() does but according to the dates you provide inside of mktime(). Here is the form that you would put in it.
    mktime ([ int $hour = date("H") [, int $minute = date("i") [, int $second = date("s") [, int $month = date("n") [, int $day = date("j") [, int $year = date("Y") [, int $is_dst = -1 ]]]]]]] )
    the brackets mean that they are optional values, however, since the first is optional, and you want to fill in say the 4th, you will have to fill in all the parameters until that point.
    You need flash to play this tutorial.
    This tutorial goes over the following goals:
    Making Time
    Using the date function to show the made up time
    You can find this tutorial video on youtube here.

    Here are the sources used in this tutorial:
    tut019.php
    <?php
    //PHP Tutorial 019
    
    for($x= 0; $x < 11; $x++){
    
    $save =  mktime(0,0,0,2,$x,1995);
    
    echo date("D, d M Y",$save)."<br />\n";
    }
    ?>

    Here are all the php functions used in this tutorial:

    Posted by Kloplop321 @ 6:21 pm

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.