Use TimeUnit for time calculations

This commit is contained in:
P0nk
2021-09-10 18:56:03 +02:00
parent d52aedac4f
commit cdc17ef3dd
49 changed files with 268 additions and 161 deletions

View File

@@ -43,6 +43,7 @@ import java.sql.*;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
* @author RonanLana - synchronization of Fredrick modules and operation results
@@ -80,7 +81,7 @@ public class FredrickProcessor {
}
public static int timestampElapsedDays(Timestamp then, long timeNow) {
return (int) ((timeNow - then.getTime()) / (1000 * 60 * 60 * 24));
return (int) ((timeNow - then.getTime()) / TimeUnit.DAYS.toMillis(1));
}
private static String fredrickReminderMessage(int daynotes) {