I was writing PHP scripts the other day where I needed a calendar to pick dates. My user needs to pick date of any month or year. Problem was — Manual input of dates are tiresome and inefficient. On the other hand, if inputs are in string, I need to convert them to “datetime” as my datatype is such in the MySQL DB.
This code segment is for taking input and inserting into database