Java Date Time Java Java API
java.time.Instant
public ZonedDateTime atZone(ZoneId zone)
This methods returns a new instance of ZonedDateTime created from the fields of this instant at the specified time-zone.
ZonedDateTime
package com.logicbig.example.instant;import java.time.Instant;import java.time.ZoneId;import java.time.ZonedDateTime;public class AtZoneExample { public static void main(String... args) { Instant i = Instant.parse("2017-04-09T10:15:30.00Z"); System.out.println(i); ZonedDateTime d = i.atZone(ZoneId.of("America/Jamaica")); System.out.println(d); }}
2017-04-09T10:15:30Z2017-04-09T05:15:30-05:00[America/Jamaica]