I would like to generate a list of dates, but found out the date is wrong start from - 25 * 24 * 60 * 60 * 1000
My local date is 2016-07-17. I got
2016-
Much easier to use minusDays( 1 ) on java.time.LocalDate.
LocalDate today = LocalDate.now(); // Better to pass the optional `ZoneId`.
for (int i=0; i<240; i++) {
LocalDate localDate = today.minusDays( i );
System.out.println( localDate.toString() );
…
}
Much of the java.time functionality is back-ported to Java 6 & 7 in ThreeTen-Backport and further adapted to Android in ThreeTenABP.