It seems the proper form of timestamp to parse ISO-8601 in Java looks like:
"2020-02-03T23:40:17+00:00";
However mine looks like:
"2020-02-03T23:40:17+0000";
How can I parse this properly?
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;
public class TestTime {
public static void main(String[] args) {
String ts = "2020-02-03T23:40:17+0000";
DateTimeFormatter timeFormatter = DateTimeFormatter.ISO_DATE_TIME;
OffsetDateTime offsetDateTime = OffsetDateTime.parse(ts, timeFormatter);
long timestamp = offsetDateTime.toEpochSecond() * 1000;
}
}