PHP calculates the number of days between the start time and the expiration time

  • 2020-03-31 21:26:46
  • OfStack


//mktime = mktime($hours,minute,seconds,month,day,years) 
$start_time = mktime(0,0,0,01,09,2010); //The start time
$end_time = mktime(0,0,0,02,09,2010); //The end of time
$times = $end_time-$start_time; //The number of seconds between the beginning and the end
$now_time = $times/(24*3600); //So let's figure out how many there are

Mktime is in seconds

Related articles: