Skip to content

Commit 61d975c

Browse files
committed
Se agrego en LocalDates la función hoursInterval()
1 parent b7cfee3 commit 61d975c

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

commons/src/main/java/org/javabeanstack/util/LocalDates.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,4 +263,17 @@ public static Long daysInterval(LocalDateTime start, LocalDateTime end) {
263263
}
264264
return Duration.between(start, end).toDays();
265265
}
266+
267+
/**
268+
* Dias entre dos fechas
269+
* @param start fecha inicial
270+
* @param end fecha final
271+
* @return cantidad de dias entre las fechas dadas
272+
*/
273+
public static Long hoursInterval(LocalDateTime start, LocalDateTime end) {
274+
if (start == null || end == null){
275+
return null;
276+
}
277+
return Duration.between(start, end).toHours();
278+
}
266279
}

0 commit comments

Comments
 (0)