Use -- and -=

This commit is contained in:
Gary Gregory 2024-01-15 09:19:58 -05:00
parent 07fde27799
commit 64f471a31f
2 changed files with 5 additions and 5 deletions

View File

@ -1113,7 +1113,7 @@ public class DateUtils {
// truncate milliseconds
final int millisecs = val.get(Calendar.MILLISECOND);
if (ModifyType.TRUNCATE == modType || millisecs < 500) {
time = time - millisecs;
time -= millisecs;
}
if (field == Calendar.SECOND) {
done = true;

View File

@ -361,19 +361,19 @@ public class DurationFormatUtils {
if (Token.containsTokenWithValue(tokens, d)) {
days = milliseconds / DateUtils.MILLIS_PER_DAY;
milliseconds = milliseconds - (days * DateUtils.MILLIS_PER_DAY);
milliseconds -= days * DateUtils.MILLIS_PER_DAY;
}
if (Token.containsTokenWithValue(tokens, H)) {
hours = milliseconds / DateUtils.MILLIS_PER_HOUR;
milliseconds = milliseconds - (hours * DateUtils.MILLIS_PER_HOUR);
milliseconds -= hours * DateUtils.MILLIS_PER_HOUR;
}
if (Token.containsTokenWithValue(tokens, m)) {
minutes = milliseconds / DateUtils.MILLIS_PER_MINUTE;
milliseconds = milliseconds - (minutes * DateUtils.MILLIS_PER_MINUTE);
milliseconds -= minutes * DateUtils.MILLIS_PER_MINUTE;
}
if (Token.containsTokenWithValue(tokens, s)) {
seconds = milliseconds / DateUtils.MILLIS_PER_SECOND;
milliseconds = milliseconds - (seconds * DateUtils.MILLIS_PER_SECOND);
milliseconds -= seconds * DateUtils.MILLIS_PER_SECOND;
}
return format(tokens, 0, 0, days, hours, minutes, seconds, milliseconds, padWithZeros);