0

android report this error

 W/System.err(31941): java.text.ParseException: Unparseable date: "Thu, 12 Jun 2014 13:15:30 GMT" (at offset 0)

this is my dateFormat "EEE, dd MMM yyyy KK:mm:ss zzz"

any idea?

jmj
  • 237,923
  • 42
  • 401
  • 438
user1373316
  • 99
  • 1
  • 9
  • possible duplicate of [Difference, in minutes, between two dates](http://stackoverflow.com/questions/8216292/difference-in-minutes-between-two-dates) – Basil Bourque Jun 16 '14 at 20:02

2 Answers2

1

change pattern to

EEE, dd MMM yyyy kk:mm:ss z

refer the symbols in detail here

jmj
  • 237,923
  • 42
  • 401
  • 438
  • the same error with this pattern SimpleDateFormat dateFormat = new SimpleDateFormat("EEE, dd MMM yyyy kk:mm:ss z"); – user1373316 Jun 16 '14 at 21:09
  • set `Locale` explicitly then like `new SimpleDateFormat("EEE, dd MMM yyyy kk:mm:ss z", Locale.EN_US)` – jmj Jun 16 '14 at 21:14
1

KK (00-11) format use like 00, 01,..11. whereas kk (01-24) format use like 01, 02..24.
and for GMT use z instead of zzz

So try below format as dateformat

EEE, dd MMM yyyy kk:mm:ss z

For more info see Formatting hour using SimpleDateFormat

Giru Bhai
  • 14,370
  • 5
  • 46
  • 74