【问题标题】: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

【讨论】:

猜你喜欢
  • 2011-02-05
  • 2023-03-28
  • 2011-06-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多