I’m trying to make a countdown timer. I was going to use the Period class to get the difference between 2 GregorianCalendar Dates.
I keep getting a Period cannot be resolve to a type error. I’m assuming this is becouse I need another import.
I did the following
Change my import from java.util.GregorianCalendar to import java.util.*;
TRy to add import java.util.Period;, which gave a error
This must be a easy fix, just cant get it to work.
The class cannot be resolved to a type because the class is not delivered in the jre you are using. And from what I see, it is definetely not included in the java.util package (java 6 util, java 7 util).
I saw that a Period class is offered in the Joda library. There is a similar subject on stackoveflow, maybe it can be useful for you.