Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
long endTime = new Date().getTime();
public double ZeitDifferenzBerechnen(){
long endTime = new Date().getTime();
double ergebnis = 0;
String[] splitted = EingabeStartzeit.getText().toString().split(":");
long startHours = Long.parseLong(splitted[0]) * (1000 * 60 * 60); //Stunden
long startMinutes = Long.parseLong(splitted[1]) * (1000 * 60); //Minuten
long startSeconds = Long.parseLong(splitted[2]) * 1000; //Sekunden
long startMillis = startHours + startMinutes + startSeconds; //Millisekunden
ergebnis = endTime - startMillis;
return ergebnis;
}
double diffMinuten = ergebnis /(1000*60) % 60;
String[] splitted = EingabeStartzeit.getText().toString().split(":");
long startHours = Long.parseLong(splitted[0]) * (1000 * 60 * 60); //Stunden
long startMinutes = Long.parseLong(splitted[1]) * (1000 * 60); //Minuten
long startSeconds = Long.parseLong(splitted[2]) * 1000; //Sekunden
long startMillis = startHours + startMinutes + startSeconds; //Millisekunden
long startSeconds = Long.parseLong(splitted[2]) / 1000; //Sekunden
[B][COLOR="Red"] /[/COLOR][/B] 1000, nicht [B][COLOR="red"]*[/COLOR][/B]
String[] splitted = EingabeStartzeit.getText().toString().split(":");
long startHours = Long.parseLong(splitted[0]) * 60); //Stunden
long startMinutes = Long.parseLong(splitted[1]) ; //Minuten
long startSeconds = Long.parseLong(splitted[2]) /60; //Sekunden
long startMillis = startHours + startMinutes + startSeconds; //Millisekunden
long date = new Date ().getTime ();
int minutes = date / (1000 * 60) % 60;
public double ZeitDifferenzMinuten(){
long date = new Date ().getTime ();
double ergebnisMin = 0;
String[] splitted = EingabeStartzeit.getText().toString().split(":");
long startHours = Long.parseLong(splitted[0]) * (1000 * 60 * 60); //Stunden
long startMinutes = Long.parseLong(splitted[1]) * (1000 * 60); //Minuten
long startSeconds = Long.parseLong(splitted[2]) * 1000; //Sekunden
long startMillis = startHours + startMinutes + startSeconds; //Millisekunden
double startMinuten = (double)(startMillis / (1000 * 60));
System.out.println(startMinuten); //zb.13:00:00 = 780 min
double endMinuten = date / (1000 * 60) % 60;
System.out.println(endMinuten);
ergebnisMin = (endMinuten - startMinuten);
//System.out.println(ergebnisMin);
return ergebnisMin;
double startMinuten = (double)(startMillis / (1000 * 60));//Startzeit in Minuten
Date date = new Date();
Calendar calendar = GregorianCalendar.getInstance();
calendar.setTime(date);
int hours = calendar.get(Calendar.HOUR_OF_DAY);
int min = calendar.get(Calendar.MINUTE);
float sec = calendar.get(Calendar.SECOND);
double endMinuten = (hours * 60) + min + sec/60;
ergebnisMin = endMinuten - startMinuten;
AnzeigeZeitMinuten.setText(deziFormat.format(ergebnisMin));
return ergebnisMin;