I have several date data in the database with different format like this:
When
---
2021-11-20
2021-11-20 05:03:31
2021-11-20 04:19:25.4
19-11-2021 19:11
19/11/2021 17.39
19 November'21 16:00
19-November-2021
19/11/2021
19-Nov-2021
Now I would like to change them in one go regardless of the formatting it was to dd-mm-yyyy
so they can be uniformed in Java. I have found some answers in stack overflow before such as the usage of SimpleDateTime
and DateTimeFormatter
, but the datetime format were seemed as only one and they wanted to change to one specific datetime form, but in my case, the datetime form seems very random. Any idea would greatly be appreciated. Thanks in advance.
P.S. I would like to sanitize the upcoming inputs from users since it has the input field for "when", but the filling format is still up to user to pick which they like. This is sure not a good practice, but changing this fundamental and most likely used would cause such unnecessary conflict.