Підкажіть, в чому може бути помилка? Рішення наче вірне, чи я щось не помітив.
package ua.javarush.task.pro.task16.task1618;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
/*
Аби не заплутатися
*/
public class Solution {
public static void main(String[] args) {
ZoneId zone1 = ZoneId.of("Zulu");
ZoneId zone2 = ZoneId.of("Etc/GMT+8");
System.out.println(ZonedDateTime.now(zone1));
System.out.println(ZonedDateTime.now(zone2));
LocalDateTime time = changeZone(LocalDateTime.of(2020, 3, 19, 1, 40), zone1, zone2);
System.out.println(time);
}
static LocalDateTime changeZone(LocalDateTime fromDateTime, ZoneId fromZone, ZoneId toZone) {
ZonedDateTime zonedDateTime = fromDateTime.atZone(fromZone);
LocalDateTime local = zonedDateTime.toLocalDateTime();
ZonedDateTime zonedDateTime1 = local.atZone(toZone);
LocalDateTime localDateTime = zonedDateTime1.toLocalDateTime();
return localDateTime;
}
}