Date input

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
stribor
Forum Newbie
Posts: 12
Joined: Fri Apr 01, 2011 10:48 pm

Date input

Post by stribor »

I would like to compare 2 dates to see if first date comes before the second. My input is in this string in form xx-xx-yyyy. If i have 2 dates like this is there function to compare them to see which date comes first. Any suggestion would be great

Thank you
fugix
Forum Contributor
Posts: 207
Joined: Fri Mar 18, 2011 8:01 pm

Re: Date input

Post by fugix »

Code: Select all

if($date1 > $date2)
{

}
else
{

}
Post Reply