![]() LocalDate kwanzaaStart = today.withMonth( Month.DECEMBER ).withDayOfMonth( 26 ) // Kwanzaa starts on Boxing Day, day after Christmas. LocalDate today = LocalDate.now( z ) // Get today’s date for specific time zone. toLocalDate() // Extract date-only value. atZone( z ) // Adjust into the time zone in order to determine date. GivenJavaUtilDate.toInstant() // Convert from legacy class `Date` to modern class `Instant` using new methods added to old classes. ![]() At any given moment, the date varies around the globe by zone. Tl dr ZoneId z = ZoneId.of( "America/Montreal" ) // A date only has meaning within a specific time zone.
0 Comments
Leave a Reply. |