";
The date () function is used to format the time, returning a string
$date = Date ("y-m-d h:i", $curtime);
echo $date;
echo "";
The Mktime () function is used to get a timestamp from a date, return a timestamp successfully, or return FALSE
//Mktime (time, minutes, seconds, months, days, years)
$mktime = Mktime ("21", "50", "18", "12", " "," 2015 ");
echo $mktime;
echo "";
$datetime =date ("y-m-d h:i", $mktime);
echo $datetime;
echo "";
The Strtotime () function converts the date represented by an English text string to a timestamp
$strtime = "2015-10-11 12:10";
$timestr = Strtotime ("$strtime");
echo $timestr;
echo "";
echo Date ("Y-m-d h:i", $timestr);
echo "";
An example that requires a user to log in after 2 hours of landing on the site
$expiration = time () +2*3600;//gets the timestamp echo $expiration of the current time delay of 2 hours
;
? >