0

I have "2019-05-21T17:43:05.129Z" and I am using the format ' val EXPIRE_DATE_FORMAT = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ENGLISH)'

I want to ignore timezone that is why I have XXX at the end. What is the issue with my dataFormat?

Artur A
  • 257
  • 3
  • 20
  • 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 21 '19 at 18:27
  • I cannot reproduce. On my computer your formatter parses your string into `Tue May 21 19:43:05 CEST 2019` with no signs of error. I also fail to see what sense it would make to ignore the `Z` (for UTC or “Zulu time zone”). Maybe if you’d explain, we could help you better. – Ole V.V. May 21 '19 at 18:38

0 Answers0