Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

get time until start of next hour in java

    LocalDateTime start = LocalDateTime.now();
    // Hour + 1, set Minute and Second to 00
    LocalDateTime end = start.plusHours(1).truncatedTo(ChronoUnit.HOURS);

    // Get Duration
    Duration duration = Duration.between(start, end);
    long millis = duration.toMillis();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #time #start #hour #java
ADD COMMENT
Topic
Name
2+4 =