I have a form with a date field and a calendar picker. When I use this I have it entering the date as dd/mm/yyyy
. This works.
I want to store the date as yyyymmdd
though. Is there a way using javascript to reformat the date? For example, I click submit, it reformats the date and then does the submit and writes the reformatted date to the database?
Maybe there is a better approach? e.g. using a hidden input field that has the correctly formatted version of the date somehow?