为什么我的SimpleDateFormat转换正确?

时间:2014-04-28 17:56:39

标签: java parsing date simpledateformat

我的日期为字符串: 2014-06-23 22:00

要将Date作为java.util.date获取,我使用SimpleDateFormat

解析它
Date listDate = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-DD HH:mm",Locale.GERMANY);
listDate = sdf.parse(gameList.get(position).getTime());

但我的输出

    System.out.println(listDate)

2014-04-118 19:37

这里发生了什么?

1 个答案:

答案 0 :(得分:3)

DD应该是dd(小)下面是Java 7中的可用格式

enter image description here

相关问题