SimpleDateFormat "0000-00-00"

来源:互联网 发布:炮姐脸型数据 编辑:程序博客网 时间:2024/04/29 12:38
String dateStr = "0000-00-00";
SimpleDateFormat sdf = new SimpleDateFormat(datePattern);
Timestamp time = new Timestamp(sdf.parse(dateStr).getTime());

System.out.println(time.toString());


输出结果:0002-11-30 00:00:00.0

原因:http://stackoverflow.com/questions/22307641/date-value-when-entered-00-00-0000-saves-as-11-30-0002

0 0
原创粉丝点击