forked from loafle/openapi-generator-original
* [feign] use a jdk6 compatible serializer for java.util.Date See #3727 Fix #3753 * [jersey] use a jdk6 compatible DateFormat for java.util.Date
21 lines
563 B
Plaintext
21 lines
563 B
Plaintext
{{>licenseInfo}}
|
|
package {{invokerPackage}};
|
|
|
|
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
|
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
|
|
import java.text.FieldPosition;
|
|
import java.util.Date;
|
|
|
|
|
|
public class RFC3339DateFormat extends ISO8601DateFormat {
|
|
|
|
// Same as ISO8601DateFormat but serializing milliseconds.
|
|
@Override
|
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
|
String value = ISO8601Utils.format(date, true);
|
|
toAppendTo.append(value);
|
|
return toAppendTo;
|
|
}
|
|
|
|
} |