修复 日期错误的BUG

Change-Id: If1c03b641341f9287061c2c58c64ff389056189b
This commit is contained in:
rui.zhang 2020-03-05 08:54:52 +08:00
parent 08f8c10589
commit eb9fb65544
2 changed files with 6 additions and 0 deletions

View File

@ -7,6 +7,7 @@ import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
import java.text.SimpleDateFormat;
/**
* @author robin
@ -24,6 +25,10 @@ public abstract class JsonKit {
MAPPER.setSerializationInclusion(JsonInclude.Include.NON_EMPTY);
MAPPER.setSerializationInclusion(JsonInclude.Include.NON_ABSENT);
MAPPER.setDefaultPropertyInclusion(JsonInclude.Include.NON_DEFAULT);
SimpleDateFormat defaultDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
MAPPER.setDateFormat(defaultDateFormat);
}

View File

@ -76,6 +76,7 @@ public class WordPressTest {
post.setCategories("分类");
post.setTags("a", "b", "c");
post.setPostName("test-post-name");
post.setPostDateGmt(System.currentTimeMillis());
int postId = wp.newPost(post);
System.out.println(postId);
Assert.assertNotNull(postId);