-2
웹 서비스에서 datetime을 얻고 있습니다. 실제로 sqlserver db에서 데이터를 가져 오는 중입니다. 문자열을 Date로 변환하려고하면 구문 분석 예외가 발생합니다.구문 분석 중에 예외가 발생했습니다.
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());
}
UPDATE : 로그 캣의 ouptut : 04-18 18 : 54 : 48.690 : 여기
내 코드 E/회의 서비스 (8601) : DateParse 예외 : 파싱 할 날짜 : 2013-04- 12 : 11 : 25 : 26.703
왜 하향 투표 – Daniel
예외가 무엇입니까? 문자열이 맞습니까? 의견의 가치는 나를 위해 잘 작동합니다. –