ionik Posted April 15, 2008 Share Posted April 15, 2008 How would i check to make sure a user inputs the correct date format as needed ex: date format must be mm/dd/yyyy hh:mmam/pm and get the value for each one? so i could have $1 = month $2 = day $3 = year $4 = hour $5 = minute $6 = am/pm? Quote Link to comment https://forums.phpfreaks.com/topic/101222-solved-checking-date-format/ Share on other sites More sharing options...
ionik Posted April 15, 2008 Author Share Posted April 15, 2008 cant edit post? right no im doing by dividing the string up using substr and matching the vars ups, i have seen ways of doing this but they are really complex and seem to much to do just what i need and i dont know where to start to edit it Quote Link to comment https://forums.phpfreaks.com/topic/101222-solved-checking-date-format/#findComment-517764 Share on other sites More sharing options...
effigy Posted April 15, 2008 Share Posted April 15, 2008 How about date_parse? This wouldn't necessarily abide by that stringent format, but it would give you the same end result. Quote Link to comment https://forums.phpfreaks.com/topic/101222-solved-checking-date-format/#findComment-517779 Share on other sites More sharing options...
ionik Posted April 15, 2008 Author Share Posted April 15, 2008 I could use that but it would hurt the backward compatiblity to php4 servers and would still need this done anyway...i could workaround using getdate and strototime nm thnx for the help Quote Link to comment https://forums.phpfreaks.com/topic/101222-solved-checking-date-format/#findComment-517810 Share on other sites More sharing options...
effigy Posted April 15, 2008 Share Posted April 15, 2008 So this is solved? Quote Link to comment https://forums.phpfreaks.com/topic/101222-solved-checking-date-format/#findComment-517834 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.