Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@JSONField时间格式不兼容了 #2435

Open
shixiayu13 opened this issue Apr 12, 2024 · 1 comment
Open

@JSONField时间格式不兼容了 #2435

shixiayu13 opened this issue Apr 12, 2024 · 1 comment
Labels
question Further information is requested

Comments

@shixiayu13
Copy link

2.0.16版本字段@JSONField(format = "yyyy-MM-dd HH:mm:ss"),提交的表单字段格式yyyy-MM-dd HH:mm还能提交,2.0.48必须格式要求yyyy-MM-dd HH:mm:ss这种一定要一样了,如果兼容yyyy-MM-dd HH:mm

@shixiayu13 shixiayu13 added the question Further information is requested label Apr 12, 2024
@wenshao
Copy link
Member

wenshao commented Apr 13, 2024

  @Test
    public void test() {
        Bean bean = JSON.parseObject("{\"date\":\"2014-07-14 12:13\"}", Bean.class);
        assertNotNull(bean.date);
        assertEquals("{\"date\":\"2014-07-14 12:13:00\"}", JSON.toJSONString(bean));
    }

    public static class Bean {
        @JSONField(format = "yyyy-MM-dd HH:mm:ss")
        public Date date;
    }

问题未重现,请帮忙构造重现问题的testcase

wenshao added a commit that referenced this issue Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants