Math.round(float) . The float has a larger range than the long one, but it cannot represent all integers in this range - in this case, the integer 1313179440 (the original division result) lies in the part of the range that exceeds the integer accuracy.
Do not use Math.round as it is not needed (input is already an integer!) Or;
Use Math.round(double) , as in: Math.round(modificationTime/1000d) . Note that the divisor is double, and therefore the dividend (and result) of the expression also rises to double.
Happy coding.
user166390
source share