Incrementando e decrementando datas com Java 8

From Basef
Revision as of 18:04, 9 July 2017 by Admin (Talk | contribs) (Criou página com 'Exemplo: <source lang="java"> LocalDate hoje = LocalDate.now(); System.out.println(hoje.minusYears(1)); System.out.println(hoje.minusMonths(4)); System.out.println(hoje.minu...')

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Exemplo:

LocalDate hoje = LocalDate.now();
 
System.out.println(hoje.minusYears(1));
System.out.println(hoje.minusMonths(4));
System.out.println(hoje.minusDays(2));
 
System.out.println(hoje.plusYears(1));
System.out.println(hoje.plusMonths(4));
System.out.println(hoje.plusDays(2));