I need to know if there is something like a timespan in android development?
in C# there is something like and I like to use it in two ways:
Unfortunately, there's no TimeSpan
like class yet natively available in Java, but you can achieve this with few lines of code.
Calendar startDate = getStartDate();
Calendar endDate = getEndDate();
long totalMillis = endDate.getTimeInMillis() - startDate.getTimeInMillis();
int seconds = (int) (totalMillis / 1000) % 60;
int minutes = ((int)(totalMillis / 1000) / 60) % 60;
int hours = (int)(totalMillis / 1000) / 3600;