Hey, ich habe ein Problem:Zeit lang negativ
log:
04-26 11:29:09.332 21657-21784/com.grou D/answer: -3600000
04-26 11:29:09.332 21657-21784/com.grou D/answer: 12:00:00
Code:
SimpleDateFormat dateFormat = new SimpleDateFormat("hh:mm:ss");
Date parsedDate = dateFormat.parse(TimeEnd);
Timestamp timestamp = new java.sql.Timestamp(parsedDate.getTime());
tsTimeEnd = timestamp.getTime();
Log.d("answer",Long.toString(timestamp.getTime()));
timestamp.setTime(tsTimeEnd);
Log.d("answer",dateFormat.format(timestamp));
warum -3.600.000 ?? :(
Lösung:
i innerhalb von 24 Stunden bin setzen i hh oder es ist HH so 0.00.00 es normal ist, als ist negatif
Genau das, was Sie tun möchten, b/n zwei Termine? – Rajasekhar
http://StackOverflow.com/Questions/15003498/Why-does-SimpledateFormat-Parse-Gettime-Return-an-incorrect -negative-Wert –
Nop nicht funktioniert gleiche Problem Stunde ist: -1.0 – Royalxm