@Override
    public void beforeRequest(Request<?> request) {
        AmazonWebServiceRequest original = request.getOriginalRequest();
        if (original instanceof DescribeSpotFleetRequestHistoryRequest) {

            Map<String, List<String>> params = request.getParameters();
            List<String> startTime = params.get(START_TIME);

            if (startTime != null && !startTime.isEmpty()) {
                params.put(START_TIME,
                        Arrays.asList(sanitize(startTime.get(0))));
            }

        } else if (original instanceof RequestSpotFleetRequest) {

            Map<String, List<String>> params = request.getParameters();

            List<String> validFrom = params.get(VALID_FROM);
            List<String> validUntil = params.get(VALID_UNTIL);

            if (validFrom != null && !validFrom.isEmpty()) {
                params.put(VALID_FROM,
                        Arrays.asList(sanitize(validFrom.get(0))));
            }
            if (validUntil != null && !validUntil.isEmpty()) {
                params.put(VALID_UNTIL,
                        Arrays.asList(sanitize(validUntil.get(0))));
            }

        }
    }
A request handler that strips out millisecond precision from requests to
RequestSpotFleet and DescribeSpotFleetRequestHistory, which don't expect
timestamps to be so precise.
aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/transform/TimestampFormatRequestHandler.java