Die Differenz zwischen zwei Datumswerten in Tagen:
Java (LocalDateTime)
if(ldt1.isAfter(ldt2)){
days = Duration.between(ldt1.toLocalDate().atStartOfDay(), ldt2.toLocalDate().atStartOfDay()).toDays();
days = Math.abs(days);
}
Java (Date)
long days = TimeUnit.DAYS.convert(date.getTime() - date2.getTime(), TimeUnit.MILLISECONDS);
PHP
$interval = date_diff($datetime1, $datetime2);
$days = (int) $interval->format('%a');
(MySQL) SQL
select datediff('2017-12-24', current_date) waitingforxmas;
(Oracle) SQL
SELECT TO_DATE('2017-12-24', 'YYYY-MM-DD') - CURRENT_DATE WaitingForXmas
FROM dual