Hi,
I'm working on a Zend Framework (v1.7) application that calls for a few forms that users need to enter dates on.
The user is prompted to enter dates in the dd/mm/yyyy format, but the MySQL database wants the dates to be presented in yyyy-mm-dd format. Therefore, i'm having to do the following:
Loading the form
- Grab the data from the database
- Re-format the date fields using Zend_Date into the dd/mm/yyyy format
Saving the form
- Validate the date fields using Zend_Validate
- Check if the date field is present. If so, re-format it into the yyyy-mm-dd format. If not, set it to NULL
- Save to the database
There must be an easier way to do this :-S
Can anyone suggest one?
Cheers,
Matt