Hi,
generell kannst du dafür die klasse Date verwenden
String nach Integer casten und dann ab in den konstruktor:
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Date.html
Date
@Deprecated
public Date(int year,
int month,
int date,
int hrs,
int min)
Deprecated. As of JDK version 1.1, replaced by Calendar.set(year + 1900, month, date, hrs, min) or GregorianCalendar(year + 1900, month, date, hrs, min).
Allocates a Date object and initializes it so that it represents the instant at the start of the minute specified by the year, month, date, hrs, and min arguments, in the local time zone.
Parameters:
year - the year minus 1900.
month - the month between 0-11.
date - the day of the month between 1-31.
hrs - the hours between 0-23.
min - the minutes between 0-59.
Mit folgendem findest du dann die differenz in millisekunden heraus
|
Java Quellcode
|
1
|
long diff = start.getTime() - end.getTime();
|
Die Millisekunden kannst du dann wieder in eine ordentliche Zeitausgabe umwandeln
Hier ein Code für Sekunden:
http://www.easy-coding.de/java-sekunden-in-zeit-t413.html