java.time.format.DateTimeParseException: Text '20161010202413.8Z' could not be parsed at index 0

Stack Overflow | daydreamer | 2 months ago
  1. 0

    java.time.format.DateTimeParseException: Text '20161010202413.8Z' could not be parsed at index 0

    Stack Overflow | 2 months ago | daydreamer
    java.time.format.DateTimeParseException: Text '20161010202413.8Z' could not be parsed at index 0
  2. 0

    java 8 DateTimeFormatter is z and Z switched?

    Stack Overflow | 8 months ago | NinjaMester
    java.time.format.DateTimeParseException: Text '2015-01-12T13:00:00.000+02:00' could not be parsed at index 23
  3. 0

    DateTimeParseException for TIMESTAMP WITH TIME ZONE

    GitHub | 11 months ago | pschorf
    play.api.http.HttpErrorHandlerExceptions$$anon$1: Execution exception[[DateTimeParseException: Text '2016-01-17 14:28:07.456' could not be parsed at index 23]]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Using Spring @RestController with @QuerydslPredicate to handle GET With ZonedDateTime parameters

    Stack Overflow | 7 months ago | Leftwing
    java.time.format.DateTimeParseException: Text '2016-05-09T22:00:00.000Z' could not be parsed at index 10
  6. 0

    FULL PRODUCT VERSION : this is probably irrelevant java version "1.8.0_60" Java(TM) SE Runtime Environment (build 1.8.0_60-b27) Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode) ADDITIONAL OS VERSION INFORMATION : 3.19.0-61-generic #69~14.04.1-Ubuntu SMP Thu Jun 9 09:09:13 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux EXTRA RELEVANT SYSTEM CONFIGURATION : its really just appears to be a documentation bug A DESCRIPTION OF THE PROBLEM : your line: M/L month-of-year number/text 7; 07; Jul; July; J should probably be either: M/L month-of-year text/number 7; 07; Jul; July; J or L/M month-of-year number/text 7; 07; Jul; July; J the order of letters in the first column should reflect the order of values in the third column REGRESSION. Last worked in version 8u73 ADDITIONAL REGRESSION INFORMATION: it really just appears to be a documentation bug STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : import java.lang.String; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; import java.time.ZonedDateTime; class DTF { public static void main(String[] args) { String ds = "Fri Apr 01 00:13:53 EDT 2016"; String dtfmt = "EEE MMM dd HH:mm:ss z yyyy"; System.err.println(dtfmt); DateTimeFormatter fmtr = DateTimeFormatter.ofPattern(dtfmt); ZonedDateTime date = ZonedDateTime.parse(ds, fmtr); String text = date.format(fmtr); System.err.println(text); System.err.println(date.toString()); } } EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - since the string contains 'Apr', I expected that I should have used 'LLL' instead of 'MMM' to parse the string. In this case, I would expect a date parse exception such as this: Exception in thread "main" java.time.format.DateTimeParseException: Text 'Fri Apr 01 00:13:53 EDT 2016' could not be parsed at index 4 at java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:1949) at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1851) at java.time.ZonedDateTime.parse(ZonedDateTime.java:597) at DTF.main(DTF.java:15) ACTUAL - EEE MMM dd HH:mm:ss z yyyy Fri Apr 01 00:13:53 EDT 2016 2016-04-01T00:13:53-04:00[America/New_York] ERROR MESSAGES/STACK TRACES THAT OCCUR : I got no error message with the format string "EEE MMM dd HH:mm:ss z yyyy" with the format string "EEE LLL dd HH:mm:ss z yyyy", I get: Exception in thread "main" java.time.format.DateTimeParseException: Text 'Fri Apr 01 00:13:53 EDT 2016' could not be parsed at index 4 at java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:1949) at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1851) at java.time.ZonedDateTime.parse(ZonedDateTime.java:597) at DTF.main(DTF.java:15) REPRODUCIBILITY : This bug can be reproduced always. ---------- BEGIN SOURCE ---------- import java.lang.String; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; import java.time.ZonedDateTime; class DTF { public static void main(String[] args) { String ds = "Fri Apr 01 00:13:53 EDT 2016"; String dtfmt = "EEE MMM dd HH:mm:ss z yyyy"; System.err.println(dtfmt); DateTimeFormatter fmtr = DateTimeFormatter.ofPattern(dtfmt); ZonedDateTime date = ZonedDateTime.parse(ds, fmtr); String text = date.format(fmtr); System.err.println(text); System.err.println(date.toString()); } } ---------- END SOURCE ---------- CUSTOMER SUBMITTED WORKAROUND : import java.lang.String; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; import java.time.ZonedDateTime; class DTF { public static void main(String[] args) { String ds = "Fri Apr 01 00:13:53 EDT 2016"; String dtfmt = "EEE MMM dd HH:mm:ss z yyyy"; System.err.println(dtfmt); DateTimeFormatter fmtr = DateTimeFormatter.ofPattern(dtfmt); ZonedDateTime date = ZonedDateTime.parse(ds, fmtr); String text = date.format(fmtr); System.err.println(text); System.err.println(date.toString()); } }

    JDK Bug System | 6 months ago | Webbug Group
    java.time.format.DateTimeParseException: Text 'Fri Apr 01 00:13:53 EDT 2016' could not be parsed at index 4

    2 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.time.format.DateTimeParseException

      Text '20161010202413.8Z' could not be parsed at index 0

      at java.time.format.DateTimeFormatter.parseResolved0()
    2. Java RT
      ZonedDateTime.parse
      1. java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:1949)
      2. java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1851)
      3. java.time.ZonedDateTime.parse(ZonedDateTime.java:597)
      3 frames