简体   繁体   中英

Exception while formatting the parameter“ ”java.lang.IllegalArgumentException: Illegal pattern character 'T'

String dateFormat="Timestamp";
String timeVal ="2015-11-13 05:30:00.0";

return new SimpleDateFormat(dateFormat).format(new Date((((Timestamp) timeVal).getTime())));

Instead of

String dateFormat="Timestamp";

use

String dateFormat="yyyy-MM-dd HH:mm:ss";

If your date is like

String timeVal ="2015-11-13 05:30:00";

Here you must use date and time format of your date and time.

SimpleDateFormat doc

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM