Is there any way to convert ZoneId to ZoneOffset in java 8?

前端 未结 7 1213
礼貌的吻别
礼貌的吻别 2020-12-13 05:26

I have an epoch second and a zoneId,by method1.It can be convert to LocalDateTime with system default zoneId,but I don\'t find the way to convert epoch second to LocalDateTi

7条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-13 06:12

    The following returns the amount of time in milliseconds to add to UTC to get standard time in this time zone:

    TimeZone.getTimeZone(ZoneId.of("Europe/Amsterdam")).getRawOffset()
    

提交回复
热议问题