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

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -