Re: $date1 larger then current date?
| From: | Mikael Grön | Date: | Tue, 24 Apr 2007 10:58:08 +0000 |
| Subject: | Re: $date1 larger then current date? | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-27746@lists.php.net to get a copy of this message | ||
Try:
if ($date1 > $date2) {
echo "First date is a later one than Second date";
} else {
echo "Second date is the latest.";
}
It's just as easy as you thought it'd be.
Mike
Gustav Wiberg skrev:
Hi guys! I'm searching for what I thought would be an easy issue comparing dates. I just want to know if a date in variable $date1 is larger then current date. I use the format YYYY-MM-DD in $date1 and I know how to retrieve the current date and set it in $dat2 But how do I know if $date1> $date2 ? I have looked around, but I havent found any easy solution. It seems to be a big deal? Is that the case? Best regards /Gustav Wiberg