public void setTheDate()
    {
        boolean[] rgbEnabled = m_field.setEnableListeners(false);
        Calendar calAfter = m_field.getCalendar();
        Calendar calBefore = m_field.getCalendar();
        m_field.setValue(DateTimeField.currentTime(), DBConstants.DISPLAY, DBConstants.SCREEN_MOVE);   // File written or updated, set the update date
        calAfter = m_field.getCalendar();
        if (calBefore != null)
            if (calAfter.before(calBefore))
                calAfter = calBefore;   // If this was set with a different computer (clock), make sure it always increases!
        if (calAfter != null)
            if (calAfter.equals(calBefore))
        {
            calAfter.add(Calendar.SECOND, 1);   // Can't be the same as last time.
            m_field.setCalendar(calAfter, DBConstants.DISPLAY, DBConstants.SCREEN_MOVE);
        }
        Utility.getLogger().info("Set date: " + m_field.toString());
        m_field.setEnableListeners(rgbEnabled);
    }
public void setTheDate ( ) { boolean [ ] rgbEnabled = m_field . setEnableListeners ( false ) ; Calendar calAfter = m_field . getCalendar ( ) ; Calendar calBefore = m_field . getCalendar ( ) ; m_field . setValue ( DateTimeField . currentTime ( ) , DBConstants . DISPLAY , DBConstants . SCREEN_MOVE ) ; calAfter = m_field . getCalendar ( ) ; if ( calBefore != null ) if ( calAfter . before ( calBefore ) ) calAfter = calBefore ; if ( calAfter != null ) if ( calAfter . equals ( calBefore ) ) { calAfter . add ( Calendar . SECOND , 1 ) ; m_field . setCalendar ( calAfter , DBConstants . DISPLAY , DBConstants . SCREEN_MOVE ) ; } Utility . getLogger ( ) . info ( "Set date: " + m_field . toString ( ) ) ; m_field . setEnableListeners ( rgbEnabled ) ; }
Set the date field to the current time.
Also make sure the time is not the same as it is currently.