The Mktime () function returns the Unix timestamp of the date. The UNIX timestamp contains the number of seconds between the Unix era (January 1, 1970 00:00:00 GMT) and the specified time.
Grammar:
Mktime (hour,minute,second,month,day,year);
Instance:
$d = mktime(9, 12, 31, 6, 10, 2015); echo"创建日期是 " . date("Y-m-d H:i:s", $d);?>
Common time stamp functions
/** * Get start and end Unix time period */Public Function Get_start_and_end_time ($mark) {if($mark==' Yesterday ') {$start _time= Mktime (0,0,0,Date(' m '),Date(' d ') -1,Date(' Y '));$end _time= Mktime (0,0,0,Date(' m '),Date(' d '),Date(' Y ')) -1; }Elseif($mark==' Today ') {$start _time= Mktime (0,0,0,Date(' m '),Date(' d '),Date(' Y '));$end _time= Mktime (0,0,0,Date(' m '),Date(' d ') +1,Date(' Y ')) -1; }Elseif($mark==' Toweek ') {$start _time= Mktime (0,0,0,Date(' m '),Date(' d ') -Date(' W ') +1,Date(' Y '));$end _time= Mktime ( at, -, -,Date(' m '),Date(' d ') -Date(' W ') +7,Date(' Y ')); }Elseif($mark==' Tomonth ') {$start _time= Mktime (0,0,0,Date(' m '),1,Date(' Y '));$end _time= Mktime ( at, -, -,Date(' m '),Date(' t '),Date(' Y ')); }$arr[' Start_time '] =$start _time;$arr[' End_time '] =$end _time;return$arr; }
The above describes PHP to get a time period timestamp and mktime () function, including aspects of the content, I hope the PHP tutorial interested in a friend helpful.