java - DateFormat with no milliseconds -


This is probably a simple question but I am unable to find the solution.

I have a time string of 8 points long (era seconds), when I try to format it using Java DateFormat, it always assumes that my time also includes milliseconds , Therefore conversion to 16315118: 4: 31: 55.118 1 9:58:38 instead of the right time.

I do not want to edit the string to add to milliseconds, so how can I do this?

I do not even want to multiply that since 1000 I have been using it for other time formatting which includes milliseconds.

I also do not want to multiply by 1000 because I want to make it I am using, which includes milliseconds.

You are out of luck You can not use the same DateFormat to format two different time values. Either use two different formats or change your time value (more accurately).

Your time value should be in milliseconds because APIs are expected. Nothing is a hack


Comments