java.time.LocalDateTime.parse(CharSequence text, DateTimeFormatter formatter)


java.time.LocalDateTime.parse(CharSequence text, DateTimeFormatter formatter)

package com.codingdict;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class LocalDateTimeDemo {
   public static void main(String[] args) {

      DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME;
      String date = "2017-12-03T10:15:30+01:00";
      LocalDateTime date1 = LocalDateTime.parse(date, dateTimeFormatter);
      System.out.println(date1);
   }
}