clock - Get time as year/month/day/hour/minutes and convert to millisecond like getTime() in java or android -
i want time user(with editbox year/month/day/hour/minutes). how can convert millisecond gettime function or convert minutes gettime()/60000?
you can use datepicker
, use getters either make calendar
object or time in millis.
i use function in projects calendar
datepicker
, may want extend set hours/ minutes well:
public static calendar getcalenderfromdatepicker(datepicker dp) { int day = dp.getdayofmonth(); int month = dp.getmonth(); int year = dp.getyear(); calendar calendar = calendar.getinstance(); calendar.set(year, month, day); return calendar; }
once have calendar
can use mycalendar.gettimeinmillis()
returns long
of time in millis since epoch.
Comments
Post a Comment