Mktime
(PHP3, PHP4)
Mktime---&http://www.aliyun.com/zixun/aggregation/37954.html ">nbsp; Unix time stamp with date acquired
Syntax: int mktime (int hour, int minute, int second, int month, int day, int [, int is_dst])
Description:
Warning: The order of this function parameter differs from the order of the parameters in the normal Unix mktime (), and does not provide a left-to-right omitted argument, which is a common error in the program.
The given parameter returns the UNIX timestamp, which is a total number of seconds between the Unux period (whose 1 1970) and the specified time, and the time stamp returned is a long integer.
Parameters can be omitted from the right to left order, and any argument omitted in this manner will be set to the current value according to the local date and time.
The IS_DST can be set to 1 if the time is the entire period in DST (daylight savings time), or 0 if not, or 1 (preset) If you do not know if you are in the range of DST (daylight savings times).
Note: IS_DST is added to 3.0.10.
Mktime () is useful for calculating and confirming dates, and it automatically calculates the correct values, for example: The following lines will produce a string "jan-01-1998".
Example:
<?php
echo Date ("M-d-y", Mktime (0,0,0,12,32,1997));
echo Date ("M-d-y", Mktime (0,0,0,13,1,1997));
echo Date ("M-d-y", Mktime (0,0,0,1,1,1998));
echo Date ("M-d-y", Mktime (0,0,0,1,1,98));
?>
Year can be a value of two or four digits, and the range of values is 0-69, 2000-2069, and 70-99, 1970-1999.
The final day of next month can be expressed as "0" by any given month, and the following examples will produce a string "The Last Days in modified is:29".
Example:
<?php
$lastday = Mktime (0,0,0,3,0,2000);
Echo strftime ("Last Day in Modified:%d", $lastday);
$lastday = Mktime (0,0,0,4,-31,2000);
Echo strftime ("Last Day in Modified:%d", $lastday);
?>
Reference: Date () time ()