Page 1 of 1
Reading User-input Dates
Posted: Thu Apr 10, 2008 8:02 pm
by luo ge

I am a fairly new PHP beginner. Is there an easy way to ensure that a date entered by a user in a non-American setting as "1/5/2008" will be correctly interpreted by PHP (strtotime) as "1 May 2008", and not changed to "5 January 2008"?
Re: Reading User-input Dates
Posted: Fri Apr 11, 2008 3:03 am
by Rovas
Simple you put the form in the american way: Month select, Day select, Year select or text that indicates that the date must be inputed in that way. Saves you a lot of trouble for verifying the data inputed, using substring function to modify the inputed string.
Re: Reading User-input Dates
Posted: Sun Apr 13, 2008 7:27 pm
by luo ge
So you are saying that there is not an easy way to allow people to enter the date in the manner that they are accustomed to, and are therefore less likely to make an error with, and which also seems somewhat more logical than the "start-in-the middle" American way.
Re: Reading User-input Dates
Posted: Sun Jan 25, 2009 10:15 am
by Popcorn