2 This code performs integer multiply and then converts the result to a long,
6 long convertDaysToMilliseconds(int days) { return 1000*3600*24*days; }
8 If the multiplication is done using long arithmetic, you can avoid
9 the possibility that the result will overflow. For example, you
10 could fix the above code to:
13 long convertDaysToMilliseconds(int days) { return 1000L*3600*24*days; }
18 static final long MILLISECONDS_PER_DAY = 24L*3600*1000;
19 long convertDaysToMilliseconds(int days) { return days * MILLISECONDS_PER_DAY; }