mil.dod.th.ose.gui.webapp/src/mil/dod/th/ose/gui/webapp/utils/DateTimeConverterUtil.java
public static Date roundToEndOfSecond(final Date date)
    {
        final int maxMsToAdd = 999;
        final int millisecondsInASecond = 1000;
        final long remainder = date.getTime() % millisecondsInASecond;
        final long millisecondsToAdd = maxMsToAdd - remainder;
        
        final Instant adjustedEndDate = date.toInstant().plusMillis(millisecondsToAdd);
        return Date.from(adjustedEndDate);
    }
/**
     * Rounds the specified date to the last millisecond of the given second for the date.
     * 
     * @param date
     *      The date to be rounded.
     * @return
     *      The rounded date.
     */
Rounds the specified date to the last millisecond of the given second for the date.

@param date
The date to be rounded.
@return
The rounded date.
Rounds the specified date to the last millisecond of the given second for the date . @param date The date to be rounded . @return The rounded date .
public static Date roundToEndOfSecond(final Date date)
    {
        final int maxMsToAdd = 999;
        final int millisecondsInASecond = 1000;
        final long remainder = date.getTime() % millisecondsInASecond;
        final long millisecondsToAdd = maxMsToAdd - remainder;
        final Instant adjustedEndDate = date.toInstant().plusMillis(millisecondsToAdd);
        return Date.from(adjustedEndDate);
    }
public static Date roundToEndOfSecond ( final Date date ) { final int maxMsToAdd = 999 ; final int millisecondsInASecond = 1000 ; final long remainder = date . getTime ( ) % millisecondsInASecond ; final long millisecondsToAdd = maxMsToAdd - remainder ; final Instant adjustedEndDate = date . toInstant ( ) . plusMillis ( millisecondsToAdd ) ; return Date . from ( adjustedEndDate ) ; }
Rounds the specified date to the last millisecond of the given second for the date.
Rounds the specified date to the last millisecond of the given second for the date .