Date & Time ??




I save the date in a feild in the MySQL Database named 'date' with type varchar( 8 ) like this "YYYYMMDD" e.g. : "20050503" ..

And I want to let the users search for the records date like this :
1. Today's Records.
2. Last Week .
3. Last Month .
4. Specific date : and here the user must enter the date he wants to search for.

A. How can I code this script ??
B. What if the users entered the date like this : 03/05/2005, or 3-5-2005, or 5/3/2005 (M/D/Y) ....... How can get the date from any of these ??


why not use PHP date() function or MySQL NOW() function?!

why reinvent the wheel?
search this forum as we have already explained thousand times how to use those functions..

for instance there was a question about how to find all the records that have been enter more than 1 month ago..
Alexei is absolutely right. PHP & MySQL have nice functions.