【发布时间】:2013-07-06 13:23:20
【问题描述】:
我想验证 YYYY-MM-DD_hh:mm:ss 格式的日期
@Past //validates for a date that is present or past. But what are the formats it accepts
如果那不可能,我想使用@Pattern。但是在@Pattern 中使用上述格式的regex 是什么?
【问题讨论】:
-
如果你碰巧使用 Spring,你可以使用
@DateTimeFormat。
标签: java date design-patterns format bean-validation