import java.util.Date;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.text.ParseException;
import java.util.Calendar;
import java.util.concurrent.TimeUnit;
class Ideone
{
public static void main
(String[] args
) {
try {
System.
out.
print( diferencaHoras
("02/01/2018 23:00",
"03/01/2018 12:00") ); System.
out.
println(e.
getMessage()); }
}
/* Alteração */
long diff = d1.getTime() - d2.getTime();
int diffHours = (int) (diff / (60 * 60 * 1000));
return diffHours;
}
}
aW1wb3J0IGphdmEudXRpbC5EYXRlOwppbXBvcnQgamF2YS50ZXh0LkRhdGVGb3JtYXQ7CmltcG9ydCBqYXZhLnRleHQuU2ltcGxlRGF0ZUZvcm1hdDsKaW1wb3J0IGphdmEudGV4dC5QYXJzZUV4Y2VwdGlvbjsKaW1wb3J0IGphdmEudXRpbC5DYWxlbmRhcjsKaW1wb3J0IGphdmEudXRpbC5jb25jdXJyZW50LlRpbWVVbml0OwoKY2xhc3MgSWRlb25lCnsKICAKICBwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmdbXSBhcmdzKQogIHsKICAgIHRyeSB7CiAgICAJU3lzdGVtLm91dC5wcmludCggZGlmZXJlbmNhSG9yYXMoIjAyLzAxLzIwMTggMjM6MDAiLCAiMDMvMDEvMjAxOCAxMjowMCIpICk7CiAgICB9IGNhdGNoKEV4Y2VwdGlvbiBlKSB7CiAgICAgIAlTeXN0ZW0ub3V0LnByaW50bG4oZS5nZXRNZXNzYWdlKCkpOwogICAgfQogIH0KICAKICBwdWJsaWMgc3RhdGljIGludCBkaWZlcmVuY2FIb3JhcyhTdHJpbmcgaDEsIFN0cmluZyBoMikgdGhyb3dzIFBhcnNlRXhjZXB0aW9uewoKCS8qIEFsdGVyYcOnw6NvICovCiAgICBEYXRlRm9ybWF0IGRmID0gbmV3IFNpbXBsZURhdGVGb3JtYXQoImRkL01NL3l5eXkgSEg6bW0iKTsKCiAgICBEYXRlIGQxID0gZGYucGFyc2UgKGgxKTsKICAgIERhdGUgZDIgPSBkZi5wYXJzZSAoaDIpOwoKICAgIGxvbmcgZGlmZiA9IGQxLmdldFRpbWUoKSAtIGQyLmdldFRpbWUoKTsKICAgIAogICAgaW50IGRpZmZIb3VycyA9IChpbnQpIChkaWZmIC8gKDYwICogNjAgKiAxMDAwKSk7CgogICAgcmV0dXJuIGRpZmZIb3VyczsKICB9Cn0=