Skip to content

Instantly share code, notes, and snippets.

@manigandanta
Created April 16, 2012 11:01
Show Gist options
  • Save manigandanta/2397769 to your computer and use it in GitHub Desktop.
Save manigandanta/2397769 to your computer and use it in GitHub Desktop.
Find Greater date
<?php
function greaterDate($start_date,$end_date)
{
$start = strtotime($start_date);
$end = strtotime($end_date);
if ($start-$end > 0)
return 1;
else
return 0;
}
$date1='2007-10-10';
$date1='2007-10-11';
if(greaterDate($date1,$date2))
echo "First parameter is greater";
else
echo "Second parameter is greater";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment