Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-3268

Bson JsonReader failed to parse the date time string "2011-01-14T00:00:00.000-0800"

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: BSON
    • None

      Using BSON JsonReader to parse below JSON string got JsonParseException with error message "Failed to parse string as a date",  but this JSON string can be imported successfully using mongoimport. It looks like JsonReader using java8 java.time.format.DataFormatter.ISO_OFFSET_DATE_TIME to parse java string, is it possible to extend the the pattern to be more flexible?

      {
          "_id": 1,
          "title": "Unlocking Android",
          "isbn": "1933988673",
          "pageCount": 416,
          "publishedDate": {
              "$date": "2009-04-01T00:11:00-0800"
          }
      }
      

       

       

            Assignee:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Reporter:
            zhao jin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: