Jump to content

[SOLVED] Date Comparison Failing.


hellonoko

Recommended Posts

I found this solution that seems to work well.

function compareDates($date1,$date2) 
	{
		$date1_array = explode("-",$date1);
		$date2_array = explode("-",$date2);

		$timestamp1 = mktime(0,0,0,$date1_array[1],$date1_array[2],$date1_array[0]);
		$timestamp2 = mktime(0,0,0,$date2_array[1],$date2_array[2],$date2_array[0]);

		return ($timestamp1 - $timestamp2);


	}

	$daystillupload = compareDates( $date = date('Y-m-d'), $lastuploaddate) / 86400;

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.