Simply create a new Calendar
with the timeInMilliseconds data from the database.
So, if you have the time in a column called date
and the data is in a table called myTable the query to get that is:
select date from myTable ... other constraints
In android, simply use the long value retrieved from the database to construct a new Calendar:
Calendar cal = new Calendar.getInstance();
cal.setTimeInMillis(timeInMsFromDatabase);
Once you have a Calendar
object, you can retrieve the values you want with the get(int field)
method.
Or, you can use the DateFormat
class.
Make sense?