date comparison II
| From: | Jacky@lilst | Date: | Mon, 15 Jan 2001 18:59:24 +0000 |
| Subject: | date comparison II | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-34569@lists.php.net to get a copy of this message | ||
Hi people,
may be I did not make my question clear about what I try to do. Basically if I have 2 date values in
the same format like yyyy-mm-dd, can I use both values to find out if one come before another and
then display message or something? Say I have $date1 = 20010115 and $date2 = 20010120 ( which of
course we can easily tell that $date1 come before $date2). Can I use the sniplet below:
if ($date1 < $date2) {
......
}else{
.....
}
Or do I need mktime() command to convert $date1 and $date2 like
if (mktime($date1) < mktime9$date2)) {
.....
}else{
....
}
cheers
Jack
jacky@activelifestyle.com
"There is nothing more rewarding than reaching the goal you set for yourself"