I want to store the output of Angulars MatDatepicker in MySQL. The issue is that the formats are not matching. Here an example when the user picks 13.11.2020:
MatDatepicker returns the Date in the following format (with timezone):
2020-11-12T23:00:00.000000Z
MySQL use datetime as format. The raw value in the db is the same (but without timezone):
2020-11-12 23:00:00
This is the query which I use to insert the datetime:
INSERT INTO testtable (`datetime`) VALUES('2020-11-12T23:00:00.000000Z');
The issue is that on return to the frontend, the 12. of november is displayed. I have a huge Formular with a lot of Datepicker. That's why I don't want to format the date by Angular. Is there a solution how I can solve that by MySQL?