This file contains 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
-- DDL | |
CREATE TABLE position ( | |
vehicle int, | |
start_date date, | |
ignition int, | |
speed int | |
); | |
-- DML |
This file contains 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
public final class DateUtil { | |
private DateUtil () { | |
} | |
public static Long diferencaEmDias(Temporal dataInicio, Temporal dataFim) { | |
Objects.requireNonNull(dataInicio); | |
Objects.requireNonNull(dataFim); | |
return ChronoUnit.DAYS.between(dataInicio, dataFim); |