Why are the outcomes different for first and first1? I’m guessing it has to do with the limit for the Long type.
long seconds = System.currentTimeMillis();
long first = (seconds / (1000*60*60*24))/365;
long first1 = seconds / (1000*60*60*24*365);
System.out.println(first);
System.out.println(first1);
Thanks!
The denominator of the second one overflows the
inttype.No difference if you do it like this – use long throughout: