android - show name of the month -
i making app have show last update fitness band, date:
sqlitedatabase sql2 = new savedatabase.savedatebasehelp(this).getwritabledatabase(); cursor select = sql2.rawquery("select pedometer_year, pedometer_month, pedometer_day db_pedometer_info _id = (select _id db_pedometer_info order _id desc limit 1); ", null); try { if(select != null && select.getcount() == 1) { select.movetolast(); string year = select.getstring(select.getcolumnindex("pedometer_year")); string month = select.getstring(select.getcolumnindex("pedometer_month")); string day = select.getstring(select.getcolumnindex("pedometer_day")); globals.lastupdatedate = day + "-" + month + "-" +year; } }
this show me "11-07-2015" , want "11-jul-2015"
string[] months = new string[] { "jan", "feb", "mar", etc.... };
and when go compile date string instead of month
use:
months[integer.valueof(month)]
Comments
Post a Comment