How to get from this line 2018-07-11T09:54:40.660 +0000 Date?
1 answer
You need SimpleDateFormat to convert the string to Date.
SimpleDateFormat formatter = new SimpleDateFormat(StringPattern); formatter.parse(your_date_string) To make the desired pattern, I advise you to view this article. At the end is a table with patterns.
- and in a pattern what pattern to set? - elik
- That which I want to receive or in which there is a line? - elik
- Updated the answer. Added an article, everything is painted there. - Nuclominus
- one@elik, when parsing from a string - the pattern should match the input string, when formatting it into a string - the desired result - woesss
- @woesss thank you - elik
|
Date, then back to the string which is necessary. And do not forget about the time zone !!! - Eugene KrivenjaDateobject from this line? - woesss