java - Split the string in to center -



java - Split the string in to center -

i want split string: sun apr 12 17:56:00 gmt+05:00 2015. 17:56. tried this:

string[] splitstr = str.split("\\s+");

you string parsing date:

by string can like:

string str = "sun apr 12 17:56:00 gmt+05:00 2015"; string time = str.split(" ")[3]; system.out.println(time.substring(0, time.lastindexof(':')));

by dateformat utilize pattern parse date , hr , minutes pattern below:

string str = "sun apr 12 17:56:00 gmt+05:00 2015"; simpledateformat df = new simpledateformat("eee mmm d hh:mm:ss zzz yyyy");

java android

Comments

Popular posts from this blog

Using Android Volley to post an array to PHP -

python - How to add an model instance to a django queryset? -

angularjs - No 'Access-Control-Allow-Origin' error from local domain to public API -