bobrivers2003
Technical User
Hi there,
I have the following code:
DateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
System.out.println(sdf.format(new Date()));
that prints the date in a given format. In this class I have an intand based on that int I would want to increase/decrease the date by that value. E.g. if the date is 12/10/2006 and the given int was 2 I want to change the date to 14/10/2006. (Likewise for -ve numbers)
I have heard of calendar objects but have no idea how to implement them.
Any help would be greatly appreciated.
Thanks and Regards
I have the following code:
DateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
System.out.println(sdf.format(new Date()));
that prints the date in a given format. In this class I have an intand based on that int I would want to increase/decrease the date by that value. E.g. if the date is 12/10/2006 and the given int was 2 I want to change the date to 14/10/2006. (Likewise for -ve numbers)
I have heard of calendar objects but have no idea how to implement them.
Any help would be greatly appreciated.
Thanks and Regards