java.text.ParseException: Unparseable date: "2016-09-06 05:18:06.023 PM" (at offset 24) Weird part is that the device on which this exception has occurred is a friend's Nexus 5. However, if I debug this same string on my Nexus 5 / several other emulators, it works fine. Here is the code that I'm using. SimpleDateFormat belongs to java.text package. Date belongs to java.util package SimpleDateFormat formatGMT = new SimpleDateFormat("yyyy-MM-dd KK:mm:ss.SSS a"); formatGMT.setTimeZone(TimeZone.getTimeZone("GMT")); try { date = formatGMT.parse("2016-09-06 05:18:06.023 PM"); } catch (ParseException e) { Crashlytics.log(Log.ERROR, "DB Insertion error", e.getMessage().toString()); Crashlytics.logException(e); e.printStackTrace(); } Here is the full stack trace. # Crashlytics - plaintext stacktrace Wed, 07 Sep 2016 03:37:44 GMT # Platform: android # Bundle Identifier: com.mypackage.app # Issue #: 306 # Date: 2016-09-06T17:18:04Z # OS Version: 6.0.1 # Device: Nexus 5 # RAM Free: 36.5% # Disk Free: 11% #0. Crashed: pool-3-thread-3: 0 0 0x0000000000000000

Stack Overflow | Abhilash | 3 months ago
  1. 0

    java.text.ParseException: Unparseable date on some devices only

    Stack Overflow | 3 months ago | Abhilash
    java.text.ParseException: Unparseable date: "2016-09-06 05:18:06.023 PM" (at offset 24) Weird part is that the device on which this exception has occurred is a friend's Nexus 5. However, if I debug this same string on my Nexus 5 / several other emulators, it works fine. Here is the code that I'm using. SimpleDateFormat belongs to java.text package. Date belongs to java.util package SimpleDateFormat formatGMT = new SimpleDateFormat("yyyy-MM-dd KK:mm:ss.SSS a"); formatGMT.setTimeZone(TimeZone.getTimeZone("GMT")); try { date = formatGMT.parse("2016-09-06 05:18:06.023 PM"); } catch (ParseException e) { Crashlytics.log(Log.ERROR, "DB Insertion error", e.getMessage().toString()); Crashlytics.logException(e); e.printStackTrace(); } Here is the full stack trace. # Crashlytics - plaintext stacktrace Wed, 07 Sep 2016 03:37:44 GMT # Platform: android # Bundle Identifier: com.mypackage.app # Issue #: 306 # Date: 2016-09-06T17:18:04Z # OS Version: 6.0.1 # Device: Nexus 5 # RAM Free: 36.5% # Disk Free: 11% #0. Crashed: pool-3-thread-3: 0 0 0x0000000000000000
  2. 0

    Android unable to write datetime to sqllite database

    Stack Overflow | 1 year ago | idclark
    java.text.ParseException: Unparseable date: "06/14/15" (at offset 8)
  3. 0

    Android parsing and formatting DateTime timestamp

    Stack Overflow | 1 year ago | idclark
    java.text.ParseException: Unparseable date: "2015-08-04T18:20:00.000-04:00" (at offset 10)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    SimpleDateFormat behaviour change in Android Marshmallow

    Stack Overflow | 1 year ago | OceanLife
    java.text.ParseException: Unparseable date: "2015-10-23 Fri 10:59 PM" (at offset 21)
  6. 0

    GitHub comment 72#151806482

    GitHub | 1 year ago | kiranboghra
    java.lang.IllegalArgumentException: java.text.ParseException: Unparseable date: "Wed,28 Oct 2015 11:09:12 GMT" (at offset 4)

  1. DoktorDoener666 1 times, last 2 weeks ago
  2. Alexandru Popa 1 times, last 3 weeks ago
  3. maxxi 8 times, last 4 days ago
  4. iridic 5 times, last 1 month ago
  5. ivotje50 33 times, last 1 month ago
23 more registered users
10 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.text.ParseException

    Unparseable date: "2016-09-06 05:18:06.023 PM" (at offset 24) Weird part is that the device on which this exception has occurred is a friend's Nexus 5. However, if I debug this same string on my Nexus 5 / several other emulators, it works fine. Here is the code that I'm using. SimpleDateFormat belongs to java.text package. Date belongs to java.util package SimpleDateFormat formatGMT = new SimpleDateFormat("yyyy-MM-dd KK:mm:ss.SSS a"); formatGMT.setTimeZone(TimeZone.getTimeZone("GMT")); try { date = formatGMT.parse("2016-09-06 05:18:06.023 PM"); } catch (ParseException e) { Crashlytics.log(Log.ERROR, "DB Insertion error", e.getMessage().toString()); Crashlytics.logException(e); e.printStackTrace(); } Here is the full stack trace. # Crashlytics - plaintext stacktrace Wed, 07 Sep 2016 03:37:44 GMT # Platform: android # Bundle Identifier: com.mypackage.app # Issue #: 306 # Date: 2016-09-06T17:18:04Z # OS Version: 6.0.1 # Device: Nexus 5 # RAM Free: 36.5% # Disk Free: 11% #0. Crashed: pool-3-thread-3: 0 0 0x0000000000000000

    at java.text.DateFormat.parse()
  2. Java RT
    DateFormat.parse
    1. java.text.DateFormat.parse(DateFormat.java:579)
    1 frame
  3. com.mypackage.app
    MyService$16$1.execute
    1. com.mypackage.app.MyService$16$1.execute(MyService.java:1670)
    1 frame
  4. io.realm
    Realm$1.run
    1. io.realm.Realm$1.run(Realm.java:1187)
    1 frame
  5. io.realm.internal
    BgPriorityRunnable.run
    1. io.realm.internal.async.BgPriorityRunnable.run(BgPriorityRunnable.java:34)
    1 frame
  6. Java RT
    Thread.run
    1. java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
    2. java.util.concurrent.FutureTask.run(FutureTask.java:237)
    3. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
    4. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
    5. java.lang.Thread.run(Thread.java:818)
    5 frames