![]() |
| Adobe Forums » Adobe Influences » Dynamic Html » Any cure for MySQL date entry problem? |
| Tags: |
![]() |
| LinkBack | Thread Tools | Display Modes |
|
|||
|
On user entry forms with a MySQL database, dates must be entered as YYYY-MM-DD,
which for Americans is counter-intitutive. I know about the option to use a series of very long drop-down lists to select each of the pieces, but I find that both cumbersome and time consuming. I currently am using instructions to the user with each date field, but that is clutzy. Does anybody know of a way to use "mm/dd/yyyy"? Thanks! Marty |
|
|||
|
.oO(MartyMatthews)
>On user entry forms with a MySQL database, dates must be entered as YYYY-MM-DD, >which for Americans is counter-intitutive. I know about the option to use a >series of very long drop-down lists to select each of the pieces, but I find >that both cumbersome and time consuming. I currently am using instructions to >the user with each date field, but that is clutzy. > > Does anybody know of a way to use "mm/dd/yyyy"? MySQL expects the dates to be stored as YYYY-MM-DD in a DATE or DATETIME field. Use your script to convert from MM/DD/YYYY if necessary, before you insert the date into the DB. If you're on PHP, have a look at its date and time functions, especially strtotime() and strftime(). Micha |
![]() |
| Thread Tools | |
| Display Modes | |
|
|