ari.wayan wrote:No, do not do date logic by hand. that is a great way to get the wrong answer. the correct way to do Date manipulation logic in java is:
Use SimpleDateFormat to convert the date object to string. Once the string object converted to date object use the getTime() method to get the date in milliseconds.
Now you can easily adds/substract the date object.
Remember, the resulting long value from getTime() method is in milliseconds, to get the value in minutes you need to multiply it by 1000 and by seconds in a minutes, that is 60.