I'm wondering what is the correct pattern to parse 2018-05-21 23:05:51
to Date
object using simpleDateFormat.parse
method
Asked
Active
Viewed 37 times
1

Ali Habbash
- 777
- 2
- 6
- 29
-
2`yyyy-MM-dd hh:mm:ss`? – Yupi May 22 '18 at 21:48
-
As an aside consider throwing away the long outmoded and notoriously troublesome `SimpleDateFormat` and friends, and adding [ThreeTenABP](https://github.com/JakeWharton/ThreeTenABP) to your Android project in order to use `java.time`, the modern Java date and time API. It is so much nicer to work with. – Ole V.V. May 23 '18 at 10:30
-
Possible duplicate of [How to convert a String to Date of format yyyy-MM-dd HH:MM:ss](https://stackoverflow.com/questions/38410976/how-to-convert-a-string-to-date-of-format-yyyy-mm-dd-hhmmss) – Ole V.V. May 23 '18 at 10:32