All the values that you multiply are equal int, so the result intthat is passed in longafter the overflow has already occurred. Make one of the factors a longto multiply them with 64b commands
Try
long max = (60L * 24L * 60L * 60L * 1000L);
The suffix Lindicates that a constant is a value long, not a constant int.
language specification speaks
Integer long, ASCII L l (ell); int (§4.2.1).
- .
int int s:
(§5.1.2) , :
double, double.- ,
float, float. - ,
long, long. int