Java Date Increment -


this question has answer here:

i'm trying figure out how increment dates in java.

the date i'm trying increment is, 2012-10-01.

the following represents increments:

  • 2012-10-01 - 2013-09-30
  • 2013-10-01 - 2014-09-30
  • 2014-10-01 - 2015-09-30
  • 2015-10-01 - 2016-09-30

with new java time api can use localdate:

localdate date = localdate.parse("2012-10-01");  (int = 0; < 4; i++) {   system.out.println(date + " - " + date.plusyears(1).minusdays(1));   date = date.plusyears(1); } 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -