- RFC3339 time could be converted to any zoned time.
DateTimeFormatter formatter = DateTimeFormatter
.ofPattern("yyyy-MM-dd HH:mm:ss")
.withZone(ZoneId.of("America/Toronto"));Instant instant = Instant.parse( "2020–04–05T21:00:00.000000000Z" );
ZoneId z = ZoneId.of( "America/Toronto" );
ZonedDateTime zdt = instant.atZone( z );
System.out.io.print(zdt.format((formatter)));
2. Unix timestamps
DateTimeFormatter formatter = DateTimeFormatter
.ofPattern("yyyy-MM-dd HH:mm:ss")
.withZone(ZoneId.of("America/Toronto"));Instant instant = Instant.ofEpochMilli(Long.parseLong("1586379600")*1000);
ZoneId z = ZoneId.of( "America/Toronto" );
ZonedDateTime zdt = instant.atZone( z );
System.out.io.print(zdt.format((formatter)));