Java 9+
LocalDate.ofInstant(...);
arrived in Java 9.
Instant instant = Instant.parse( "2020-01-23T00:00:00Z" );
ZoneId z = ZoneId.of( "America/Edmonton" );
LocalDate ld = LocalDate.ofInstant( instant , z );
See code run live at IdeOne.com.
Notice the date is 22nd rather than 23rd as that time zone uses an offset several hours before UTC.
2020-01-22
Java 8
ZonedDateTime
has a .toLocalDate()
method in Java 8.
yourInstant.atZone(yourZoneId).toLocalDate();
Will work with earlier versions for LocalDate...
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…