mktime and strtotime

mktime and strtotime

mktime function used to get time stamp for a date.
It gets hour,minute,second,month,day,year as integer and covert it to time.
Using strtotime, we convert English textual datetime description into time

Syntax:

int mktime ( int hour, int minute, int second, int month, int day, int year [, int is_dst])

int strtotime ( string time [, int now])

Example:

<?php
$day = mktime (0,0,0,3,2,2000);
echo “Date is :”.date(”M-d-Y”,$day);
?>

Output:

Date is : Mar-02-2000

Leave a Reply

You must be logged in to post a comment.


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.