I need to create two date objects. If the current date and time is March 9th 2012 11:30 AM then
date object d1 should be 9th March 20
If you are able to add external libs to your project. I would recommend that you try out Joda-time. It has a very clever way of working with dates.
http://joda-time.sourceforge.net/