How to add timestamp in php: You can use the mktime() function to add it. This function returns the UNIX timestamp of a date, or FALSE if it is an error. The specific usage is as follows: [mktime(0,0,0,date("m"),date("d") 1,date("Y"))].
The mktime() function returns the UNIX timestamp of a date, or FALSE on error.
(Recommended tutorial: php graphic tutorial)
Syntax:
mktime(hour,minute,second,month,day,year,is_dst);
Parameters:
hour is optional. Specified hours.
#minute Optional. prescribed points.
#second Optional. Specifies seconds.
#month Optional. Specified month.
day Optional. Specify days.
#year Optional. Specified year.
is_dst Optional. Set to 1 if the time is during daylight saving time, 0 otherwise, or -1 (default) if unknown.
(Video tutorial recommendation: php video tutorial)
Code implementation:
<?php $tomorrow = mktime(0,0,0,date("m"),date("d")+1,date("Y")); echo "Tomorrow is ".date("Y/m/d", $tomorrow); ?>
Output result:
Tomorrow is 2009/05/12
The above is the detailed content of How to add timestamp in php. For more information, please follow other related articles on the PHP Chinese website!