小编Pri*_*nka的帖子

java.text.parseException:无法解析的日期:2020-02-06T08:00:00

当我将特定格式应用于日期时出现解析异常。

SimpleDateFormat df = new SimpleDateFormat("hh:mm a");
try {
    String s=timeSlotsArrayList.get(position).getScheduledStartTime();
    Date d = df.parse(s);
    times.setText(df.format(d));
}
catch (ParseException e) {
    e.printStackTrace();
}
Run Code Online (Sandbox Code Playgroud)

AM 正在获取而不是 PM 问题图像

AM 正在获取而不是 PM 问题图像

format time android simpledateformat parseexception

6
推荐指数
1
解决办法
3034
查看次数

标签 统计

android ×1

format ×1

parseexception ×1

simpledateformat ×1

time ×1