Forum Moderators: coopster

Message Too Old, No Replies

If date is between one date and another

         

tresmom5

11:04 pm on Apr 17, 2006 (gmt 0)

10+ Year Member



Ok, this should be easy, but my php is so lousy. Anyhow trying to use an if statement to echo something if it is between one date and another.

if (date (BETWEEN '2006-04-15' AND '2006-04-20'))
) {
echo "I did this right";
}

Ok, this is what I tried, but obviously, this is not right. Any help would be appreciated.

Habtom

4:13 am on Apr 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could go easy:

if (mydate > '2006-04-15' AND mydate < '2006-04-20'))
) {
echo "I did this right";
}

You better do it with time stamps though.

Hab