I have a class that I would like to store specific times in. The times will be used to schedule tasks to execute. And right now I’m working with the Time class from android.text.format, but this isn’t exactly what I’m looking for.
I can create time stamps, but it pads it with the date, timezone, etc.
Time startTime = new Time();
startTime.setToNow();
tvConsole.setText(startTime.toString()); // just to view it in the emulator
and the results:
20101208T162807America/New_York(3,341,-18000,0,1291843687)
I do not need all of this information, nor do I want it. Is there any way to just access the hh/mm/ss members? I am aware I can set just time of the object, but then it displays as some date in 1970… and I can’t retrieve just the time members. Is there another class I am not aware of that I can do this with?
Thanks
After some looking around I found what I was looking for. The answer is the
Calendarclass. I included a sample of code below.This will display:
10:30:40 PM