I need to parse a String in the following format 2015-01-15-05:00 to LocalDate(or smth else) in UTC.
The problem is that the following code:
Sys
Seems like I've found a solution. Here it is:
TemporalAccessor temporalAccessor = DateTimeFormatter.ISO_OFFSET_DATE.parse("2015-01-15-05:00");
ZonedDateTime zonedDateTime = ZonedDateTime.of(LocalDate.from(temporalAccessor), LocalTime.MAX, ZoneId.from(temporalAccessor));
System.out.println(zonedDateTime.withZoneSameInstant(ZoneOffset.UTC).toLocalDate());