android - Convert milliSeconds To Gregorian Calendar -
android - Convert milliSeconds To Gregorian Calendar -
i want convert milliseconds in long format gregorian calendar. searching in web, utilize code below:
public static string getstringdate(int juliandate){ gregoriancalendar gcal = new gregoriancalendar(); time gtime = new time(); gtime.setjulianday(juliandate); gcal.settimeinmillis(gtime.tomillis(false)); string gstring = utils.getdf().format(gcal.gettime()); homecoming gstring; } public static simpledateformat getdf(){ homecoming new simpledateformat("yyyy-mm-dd, hh:mm",locale.us); }
yes, code works find date , hr right there errors on minutes. if thing happens on 2014-11-06, 14:00, give me 2014-11-06, 14:11. want know there solutions modify or not recommended convert time gregorian calendar. many thanks!
the problem simple, modify simpledateformat("yyyy-mm-dd, hh:mm",locale.us) with
simpledateformat("yyyy-mm-dd, hh:mm",locale.getdefault());
will solve problem
android time calendar gregorian-calendar
Comments
Post a Comment