1. Computing
Send to a Friend via Email

Mktime () PHP Function

By

Definition: The mktime () function is used to get the timestamp for a specified date. It is phrased as mktime ( hour, minute, second, month, day, year, is_dst)

Hour - Number of the hour
Minute - Number of the minute
Second - Number of seconds past the minute
Month - Number of the month
Day - Number of the day
Year - Two or four digit representation of the year. If you use 2 digit 00-69 will be prefixed with 20 (2000-2069) and 70-99 will be prefixed with 19 (1970-1999). If you use 100 it will in interpreted as 2000.
Is_dst - Represents daylight savings time 1=yes, 0=no, and -1= default/unknown.

Examples:

 <?php
 echo date("M-d-Y", mktime(12, 15, 4, 12, 15, 1997)) ;
 echo date("M-d-Y", mktime(0, 0, 0, 1, 1, 98)) ;
 ?> 

This would output:

Dec-15-1997
Jan-01-1998

Related Video
Basic PHP Syntax
Using PHP With HTML

©2014 About.com. All rights reserved.