Java Date Time Java Java API
java.time.ZonedDateTime
public ZoneOffset getOffset()
Returns a corresponding ZoneOffset instance.
package com.logicbig.example.zoneddatetime;import java.time.ZoneOffset;import java.time.ZonedDateTime;public class GetOffsetExample { public static void main(String... args) { ZonedDateTime d = ZonedDateTime.now(); System.out.println(d); ZoneOffset offset = d.getOffset(); System.out.println(offset); }}
2017-05-01T16:12:08.247-05:00[America/Chicago]-05:00