2016-07-16 15 views
0

は私のJSONに私は次の出力解析JSONデータ、Androidの

...... 
"publish_date": "2016-07-16 08:09:41" 
...... 

SimpleDateFormat

例を使用してJSON

+0

部分文字列を使用すると、最後の8文字は無視できます。 –

+0

ありがとう!うまく働いている 'TextView txdate =(TextView)findViewById(R.id.date_item); getDate = getDate.substring(0、getDate.length() - 8); txdate.setText(getDate); ' – ivan

答えて

0

調整せずに、/解析時間なし日付のみを抽出することが可能です持っている:

String s = "your parsed jsonObject" ; 
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); 
System.out.println(simpleDateFormat.parse(s));