Round timestamps from pump history to full second to align with DB.

This commit is contained in:
Johannes Mockenhaupt 2017-11-13 22:55:16 +01:00
parent d76740dda7
commit b99513aafb
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -272,7 +272,8 @@ public class ReadHistoryCommand extends BaseCommand {
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.set(year, date.getMonth() - 1, date.getDay(), time.getHour(), time.getMinute(), 0); calendar.set(year, date.getMonth() - 1, date.getDay(), time.getHour(), time.getMinute(), 0);
return calendar.getTimeInMillis(); // round to second
return calendar.getTimeInMillis() - calendar.getTimeInMillis() % 1000;
} }