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


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

package com.codingdict;

import java.time.OffsetTime;
import java.time.format.DateTimeFormatter;

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

      DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ISO_OFFSET_TIME;
      String time = "10:15:30+01:00";
      OffsetTime time1 = OffsetTime.parse(time, dateTimeFormatter);
      System.out.println(time1);
   }
}