I am stuck trying to parse this date string, can any one please help, getting the below error while parsing
Exception in thread "main" java.text.ParseException: Unparseable date: "2022-09-22T11:22:39GMT-06:00" at java.base/java.text.DateFormat.parse(DateFormat.java:396) at Main.main(Main.java:16)
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.TimeZone;
import java.text.ParseException;
public class Main {
public static void main(String[] args) throws ParseException {
String dateString = "2022-09-22T11:22:39GMT-06:00";
System.out.println("Hello World!");
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss a");
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
simpleDateFormat.parse(dateString);
}
}
Can any one help this parse, not able to parse this string