I have this problem, where I want to extract some data out of an arraylist
. My arraylist
looks like this:
List<String> allDate_time = new ArrayList<String>();
What my code is doing with this arraylist
, is that I pull some data out of JSON
and I store it in this arraylist
. As you can see here:
JSONObject date_timeArray = json2.getJSONObject( 0 );
String date_time = date_timeArray.getString( "date_time" );
allDate_time.add( date_time );
What I'm receiving when I try to pull data out of the arraylist
, by doing this:
dateView = (TextView) findViewById( R.id.dateTX );
dateView.setText( allDate_time.get( 0 ) );
Then I get a value like this which looks like this:
2018-03-18T01:39:45+01:00
Is there anyway, that I can extract only the date? So that when I setText
, the value will only be
2018-03-18
And then, I can make another call setText
giving me the value of time:
01:39:45