With the new API, I can have a local date and time:
LocalTime localTime = LocalTime.of(9,0,0);
LocalDate localDate = LocalDate.of(2017, Month.JUNE, 3);
LocalDateTime localDateTime = LocalDateTime.of(localDate, localTime);
System.out.println("LocalDateTime:" + localDateTime);
I can also use ZoneId if I need to convert the time to a specific time zone:
ZonedDateTime zonedDateTime = ZonedDateTime.of(localDateTime, ZoneId.of("GMT"));
System.out.println("ZonedDateTime: " + zonedDateTime);
ZonedDateTime zonedDateTime2 = ZonedDateTime.of(localDateTime, ZoneId.of("Europe/London"));
System.out.println("ZonedDateTime London: " + zonedDateTime2);
I can get the current time:
Instant currentTime = Instant.now();
My question is. Is it possible to get the definition of ZoneId and the definition of the digit (for example, +04: 00) of the current time that is used on the client machine with this new API
source
share