DateFormat pattern “yyyy-MM-dd'T'HH:mm:ss.SSS'Z'” in Gson
问题 I have two field like below ( pay attention that the first field has milliseconds section ): { "updateTime":"2011-11-02T02:50:12.208Z", "deliverTime":"1899-12-31T16:00:00Z" } I want to deserialize the Json string to an object with Gson, so I get a Gson instance: GsonBuilder gb = new GsonBuilder(); gb.setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); gson = gb.create(); The first field is deserialized to Java date type: 2011-11-02 02:50:12.208 (looks like ignored the time zone section-‘Z’, that's