Created
February 3, 2019 16:42
-
-
Save ravibharathii/3e1ed8e53025219a4b47268d3aee26ea to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LocalTime midnight = LocalTime.MIDNIGHT; | |
System.out.println(midnight); | |
LocalDate today = LocalDate.now(ZoneId.of("UTC")); | |
System.out.println(today); | |
LocalDateTime todayMidnight = LocalDateTime.of(today, midnight); | |
System.out.println(todayMidnight); | |
ZonedDateTime todyzdt = todayMidnight.atZone(ZoneId.of("UTC")); | |
System.out.println(todyzdt); | |
long todaymillis = todyzdt.toInstant().toEpochMilli(); | |
System.out.println(todaymillis); | |
LocalTime midnight1 = LocalTime.MIDNIGHT; | |
LocalDate today1 = LocalDate.now(ZoneId.of("UTC")); | |
LocalDateTime todayMidnight1 = LocalDateTime.of(today1, midnight1); | |
LocalDateTime tomorrowMidnight1 = todayMidnight1.plusDays(1); | |
ZonedDateTime todyzdt1 = todayMidnight1.atZone(ZoneId.of("UTC")); | |
long todaymillis1 = todyzdt1.toInstant().toEpochMilli(); | |
ZonedDateTime tomorrowzdt1 = tomorrowMidnight1.atZone(ZoneId.of("UTC")); | |
long tomorrowmillis = tomorrowzdt1.toInstant().toEpochMilli(); | |
System.out.println(tomorrowmillis); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment