Watch out for the plus method in the below link:
Date generation Is it suffice?
Remember: This is a third-party functionality. so you need to download the appropriate jars & set it in the classpath.
Jesper Young wrote:Also, for something simple like what Alpesh is asking, recommending a third-party library such as Apache Commons Calendar or Joda Time is overkill.
Sure, but Joda Time isn't a utility library meant to aliviate the headaches caused by Java's standard date/time API, it's a drop-in replacement that provides a much cleaner API and a more comprehensive feature set. In my opinion it's worth considering dropping the standard API in favor of Joda Time as soon as you need to perform even very basic date/time calculations. I guess my previous post was just motivated by a strong personal preference
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.