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:
You can easily get the "TimeSpan" in milliseconds. To convert milliseconds to a formatted one, you can do a little fast and elegant calculation in your function like this,
public static String GetFormattedTimeSpan(final long ms) {
long x = ms / 1000;
long seconds = x % 60;
x /= 60;
long minutes = x % 60;
x /= 60;
long hours = x % 24;
x /= 24;
long days = x;
return String.format("%d days %d hours %d minutes %d seconds", days, hours, minutes, seconds);
}