Skip to content

Commit

Permalink
Use constant
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-p-pickering committed Sep 25, 2024
1 parent 2729323 commit 78fbacd
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -640,8 +640,7 @@ public static Date getDateForTomorrow(int hour) {
* @param days the number of days to add.
*/
public static Date addDays(Date date, double days) {

final long millisPerDay = 24L * 60 * 60 * 1000;
final long millisPerDay = SECONDS_PER_DAY * 1000;
long currentTimeInMillis = date.getTime();
long additionalMillis = (long) (days * millisPerDay);
return new Date(currentTimeInMillis + additionalMillis);
Expand Down

0 comments on commit 78fbacd

Please sign in to comment.