/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
import java.text.*;
import java.time.*;
import java.time.temporal.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
System.
out.
println(subtrairData
(dataEntrada, dataAtual
)); }
public static long subtrairData
(Date dataEntrada,
Date dataSaida
) {
LocalDateTime LocalDataEntrada = dataEntrada.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
LocalDateTime LocalDataSaida = dataSaida.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
return ChronoUnit.DAYS.between(LocalDataEntrada, LocalDataSaida);
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CmltcG9ydCBqYXZhLnRleHQuKjsKaW1wb3J0IGphdmEudGltZS4qOwppbXBvcnQgamF2YS50aW1lLnRlbXBvcmFsLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCURhdGUgZGF0YUVudHJhZGEgPSBuZXcgU2ltcGxlRGF0ZUZvcm1hdCgiZGQvTU0veXl5eSIpLnBhcnNlKCIyNy8wNC8yMDE2Iik7CgkJRGF0ZSBkYXRhQXR1YWwgPSBuZXcgRGF0ZSgpOwoJCVN5c3RlbS5vdXQucHJpbnRsbihzdWJ0cmFpckRhdGEoZGF0YUVudHJhZGEsIGRhdGFBdHVhbCkpOwoJfQoJCgkgcHVibGljIHN0YXRpYyBsb25nIHN1YnRyYWlyRGF0YShEYXRlIGRhdGFF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