Java:String to Date转换获取Unparseable异常

VJS*_*VJS 0 java java-ee

我在String中得到日期09/16/2012 15:57.我如何转换它java.util.Date

我试过了 :

SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-yy HH.mm.ss.SSS a");
dateFormat.parse(res.getString("stringdate"));
Run Code Online (Sandbox Code Playgroud)

但是得到 unparseable exception

Plz建议.

dim*_*ies 6

您的日期时间模式不正确.尝试匹配输入字符串

SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy HH:mm");
Run Code Online (Sandbox Code Playgroud)