What is the best way to handle dates with days / months, possibly with one or two digits?
I have the following DateFormat
:
yyyy-MM-dd HH:mm:ss.SSS
and the application that I am processing succeeds until one day breaks because it received a date like this:
2012-03-5 00:00:00.001 (Notice the single digit day).
I came across this: Syntax date with a possible one-bit month / day / hour using java.text.SimpleDateFormat , but it did not answer my question.
Should I do some tweaking before the date string before? Or is there any other way to clean it?
Thanks.
source share