I'm sure it's not strange, rather I didn't understand the docs, but why does:
long myLong = 3600*24*365*70;
System.out.println(String.valueOf(myLong));
display -2087447296
when that is clearly not the result of 3600*24*365*70?
I'm sure it's not strange, rather I didn't understand the docs, but why does:
long myLong = 3600*24*365*70;
System.out.println(String.valueOf(myLong));
display -2087447296
when that is clearly not the result of 3600*24*365*70?
try
long myLong = 3600L*24*365*70;
as your code is multiplying as int and then converting to a Long. The value as an int is overflowing the max value for an int, but will be OK as a long.