I have some forms on my site that use text boxes to enter dates. They
typically default to today’s date, in the format “MM/DD/YYYY”
However, sometimes a user will erase the box and type in a date, but
instead of typing 02/01/2006, they’ll type 2/1/06. Once the record is
created in the mysql database, it reads as ‘0006-02-01’ instead of
‘2006-02-01.’ Is there an easy way around this, or do I need something
in my create / update functions to catch and fix this? I have my reasons
for not using a date-picker control.
I have some forms on my site that use text boxes to enter dates. They
typically default to today’s date, in the format “MM/DD/YYYY”
However, sometimes a user will erase the box and type in a date, but
instead of typing 02/01/2006, they’ll type 2/1/06. Once the record is
created in the mysql database, it reads as ‘0006-02-01’ instead of
‘2006-02-01.’ Is there an easy way around this, or do I need something
in my create / update functions to catch and fix this? I have my reasons
for not using a date-picker control.