Migrating to Java 8 DateTime [duplicate]
问题 This question already has answers here : How to get start and end range from list of timestamps? (2 answers) Date year value showing valid when invalid [duplicate] (3 answers) Closed 2 years ago . I'm in the process of changing our existing SimpleDateFormat based code to use the new Java 8 LocalDateTime and ZonedDateTime classes. I couldn't find an easy way to convert this piece. Considering sample date and format. String testDate = "2012-12-31T10:10:10-06:00"; String testFormat = "yyyy-MM-dd