【问题标题】:Exception while formatting the parameter" "java.lang.IllegalArgumentException: Illegal pattern character 'T'格式化参数时出现异常“java.lang.IllegalArgumentException:非法模式字符'T'
【发布时间】:2015-10-12 13:28:09
【问题描述】:
String dateFormat="Timestamp";
String timeVal ="2015-11-13 05:30:00.0";
return new SimpleDateFormat(dateFormat).format(new Date((((Timestamp) timeVal).getTime())));
【问题讨论】:
标签:
java
timestamp
simpledateformat
【解决方案1】:
代替
String dateFormat="Timestamp";
使用
String dateFormat="yyyy-MM-dd HH:mm:ss";
如果你的日期是这样的
String timeVal ="2015-11-13 05:30:00";
这里你必须使用你的日期和时间的日期和时间格式。
SimpleDateFormat doc