
January 23rd, 2013, 01:12 PM
|
|
Me
|
|
Join Date: Apr 2007
Location: San Diego, CA
Posts: 2,263
 
Time spent in forums: 2 Weeks 1 Day 5 h 51 m 8 sec
Reputation Power: 9
|
|
|
You will run into problems allowing any date format like that. What date is "02-01-1990"? Feb 1 or Jan 2? strtotime won't help you decide either, it will just assume the format based on most likely the system locale format or just assume m-d-y. It won't automagically read the persons mind and know if it is jan or feb. Ideally you would control the format they enter. Use dropdowns to collect the month, day and year separately and then you know each value to put the date into the format you expect and better yet use an actual date field in mysql for storage. then you can sort, do maths and change the format to whatever the user wants to see.
|