+ } elsif ( $rounding_mode == 2 ) {
+ # Move the time back to midnight. This increases the length of the
+ # prorate interval.
+ $mnow = timelocal(0,0,0,$mday,$mon,$year);
+ ($mday,$mon,$year) = (localtime($mnow))[3..5];
+ } elsif ( $rounding_mode == 3 ) {
+ # If the time is after midnight, move it forward to the next midnight.
+ # This decreases the length of the prorate interval.
+ if ( $sec > 0 or $min > 0 or $hour > 0 ) {
+ # move to one second before midnight, then tick forward
+ $mnow = timelocal(59,59,23,$mday,$mon,$year) + 1;
+ ($mday,$mon,$year) = (localtime($mnow))[3..5];
+ }