Android 分析日期时发生异常

Android 分析日期时发生异常,android,Android,我从Web服务获取datetime,它实际上是从sqlserver数据库中提取数据,问题是我在尝试将字符串转换为日期时遇到解析异常: 这是我的密码: String tschedule = json.getString("ScheduledFor"); String tduration = json.getString("Duration"); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");

我从Web服务获取datetime,它实际上是从sqlserver数据库中提取数据,问题是我在尝试将字符串转换为日期时遇到解析异常:

这是我的密码:

String tschedule = json.getString("ScheduledFor");
String tduration = json.getString("Duration");
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
SimpleDateFormat dateFormat1 = new SimpleDateFormat("HH:mm:ss");

Date schedule = new Date();
Date duration = new Date();

try
{
schedule = dateFormat.parse(tschedule); //exception here, tschedule="2013-04-12T11:25:26.703"  
duration = dateFormat1.parse(tduration);//or exception here, tduration="03:10:00"
}
catch(Exception ex)
{
Log.e("MEETINGS SERVICE", "Parse exception: " + ex.getMessage());
}
更新: Logcat ouptut:
04-18 18:54:48.690:E/会议服务(8601):日期解析异常:无法解析的日期:2013-04-12T11:25:26.703

您缺少小数秒(粗体部分):

DateParse异常:不可解析日期:2013-04-12T11:25:26.703

确保更改模式以包括以下内容:

SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS");

请评论为什么会出现这种情况,例外情况是什么?你确定字符串是正确的吗?评论中的值对我来说很好。