java - converting full date to short date -


i'm getting date server like: mon mar 24 13:44:44 asia/calcutta 2014 want display in shorter format may : mar 24 13:44 there way this? may can covert string desired format ?

parsequery<parseobject> query = new parsequery<parseobject>(                     "case");              query.orderbydescending("updatedat");             query.setcachepolicy(parsequery.cachepolicy.network_else_cache);              ob = query.find();             (parseobject country : ob) {                 parseobject image = (parseobject) country.get("objectid");                 objectid = country.getobjectid();                 string ctitle = country.getstring("casetitle");                 string cdescription = country.getstring("casecomment");                 string nameofcreator = country.getstring("name");                 createtime = string.valueof(country.getcreatedat());                 system.out.println("the created time is" + createtime); 

output : mon mar 24 13:44:44 asia/calcutta 2014

use trick:

string date="mon mar 24 13:44:44 asia/calcutta 2014"; string reqdate=date.substring(4,16); 

it return string start index 4 , ends @ 16 character not take 16th character in string stop @ 15..as per requirement , reqdate have mar 24 13:44


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -