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

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -