Java examples for java.time:Timezone
get Time Zone Offsets
//package com.java2s; import java.time.LocalDateTime; import java.time.ZoneId; import java.time.ZoneOffset; import java.time.ZonedDateTime; import java.util.Map; import java.util.stream.Collectors; public class Main { public static Map<String, ZoneOffset> getTimeZoneOffsets(LocalDateTime localDateTime) { return ZoneId.getAvailableZoneIds().stream() .collect(Collectors.toMap(id -> id, id -> ZonedDateTime.of(localDateTime, ZoneId.of(id)).getOffset())); }/* w ww .ja v a 2 s. co m*/ }