Hi
The system that i am currrently developing has a booking form. On this booing from users will have to enter a bookstart and a bookend. However the MYSQL format for dates is YYYYMMDD. This presents a problem as on this side of the world people use the format DDMMYYYY. So users will be entering dates in that format and this leads to problems with the bookings in the database as they are in the wrong format. Does anyone know of a way in which i could convert the dates into the correct format? The fields bookstart and bookend are type DATE in the database
Thx
Gerry
Converting Dates for a mysql database
Moderator: General Moderators
The best way to do this is to have three drop down menus, one for day, one for month, one for year.
The user selects the date they want by selecting the relevent information in each drop down.
Now, when the form is submitted, you can put the information togehter in the format you require becuase you have each piece of information separate.
I believe this is the best way so as to illimate user input errors.
Mark
The user selects the date they want by selecting the relevent information in each drop down.
Now, when the form is submitted, you can put the information togehter in the format you require becuase you have each piece of information separate.
I believe this is the best way so as to illimate user input errors.
Mark
this is good...DATE_FORMAT()
http://dev.mysql.com/doc/mysql/en/Date_ ... tions.html
http://dev.mysql.com/doc/mysql/en/Date_ ... tions.html