首页javadate_timezoneJava Data Type - 如何从特定日历获取ZonedDateTime

Java Data Type - 如何从特定日历获取ZonedDateTime

我们想知道如何从特定日历获取ZonedDateTime。
import java.time.ZonedDateTime;
import java.util.GregorianCalendar;

public class Main {
    public static void main(String[] args) {
      // ZonedDateTime from specific Calendar
      ZonedDateTime gregorianCalendarDateTime = new GregorianCalendar()
              .toZonedDateTime();
      System.out.println(gregorianCalendarDateTime);
    }
}