I have wrote this code for when a form is submitted. As it stands you have to enter the date as yyyy-mm-dd. I have it so that it is output on the web page as a different format but is there a way I can let users input the date as dd-mm-yyyy or use any format?
But I would store the date as timestamp. This way you can search the database easier, and output the date in every format later without big changes. Do this if you want to: