• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in incrementing date

 
harsimran kochar
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here is the code


the problem is that it is not incrementing month
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15448
42
Android IntelliJ IDE Java Scala Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The format string in line 9 that you are using to create a SimpleDateFormat is wrong. It should be "dd-MM-yyyy". Note that "mm" means minutes; "MM" means months.
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The other issue is that you probably want to use add instead of roll. See javadoc for the difference between the two.
 
harsimran kochar
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic