I’m trying to make a simple app that will display a count down timer to December 21.
I have the following code
GregorianCalendar gToday = new GregorianCalendar();
GregorianCalendar gEndOfWorld = new GregorianCalendar();
gEndOfWorld.set(2012,12,1);
My idea was to minus the 2 dates. but It seems like there is no method to subtract dates. Is their a way to accomplish this?
And if you want to make life easy then you use the Joda Time library and then calculate the number of days between today and the end of the world quite easily. See this page for some examples.