/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
import java.time.LocalDate;
import java.time.Month;
import java.time.Period;
import java.time.temporal.ChronoUnit;
import java.time.format.DateTimeFormatter;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
//Data de hoje
LocalDate hoje = LocalDate.now();
//ultimo dia do ano 31/12/2016
LocalDate faltaFimDoAno = hoje.with(Month.DECEMBER).withDayOfMonth(31);
System.
out.
println("Hoje: " + hoje.
format(DateTimeFormatter.
ofPattern("dd/MM/yyyy"))); //saida: Hoje: 28/08/2016
System.
out.
println("Ultimo dia do ano: " + faltaFimDoAno.
format(DateTimeFormatter.
ofPattern("dd/MM/yyyy"))); //SaĆda: Ultimo dia do ano: 31/12/2016
System.
out.
println("Quantidade dias para o fim do ano: " + ChronoUnit.
DAYS.
between(hoje, faltaFimDoAno
)); }
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CmltcG9ydCBqYXZhLnRpbWUuTG9jYWxEYXRlOwppbXBvcnQgamF2YS50aW1lLk1vbnRoOwppbXBvcnQgamF2YS50aW1lLlBlcmlvZDsKaW1wb3J0IGphdmEudGltZS50ZW1wb3JhbC5DaHJvbm9Vbml0OwppbXBvcnQgamF2YS50aW1lLmZvcm1hdC5EYXRlVGltZUZvcm1hdHRlcjsKCi8qIE5hbWUgb2YgdGhlIGNsYXNzIGhhcyB0byBiZSAiTWFpbiIgb25seSBpZiB0aGUgY2xhc3MgaXMgcHVibGljLiAqLwpjbGFzcyBJZGVvbmUKewoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpIHRocm93cyBqYXZhLmxhbmcuRXhjZXB0aW9uCgl7CgkvL0RhdGEgZGUgaG9qZQogICAgICAgIExvY2FsRGF0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