I’m storing a time from a time picker in a separate ‘time’ column in my database.
At the moment I’m using the following method of receiving and storing the selected time from the picker.:
setTime = (TimePicker) findViewById(R.id.timePicker1);
Integer dobHour = setTime.getCurrentHour();
Integer dobMinute = setTime.getCurrentMinute();
Time timeToSet = new Time();
timeToSet.set(0, dobMinute, dobHour);
Database helper object with the insert method:
DBHandlerApp createApp = new DBHandlerApp(this, null, null);
createApp.open();
createApp.createAppointmentEntry(nameToSet, typeToSet, timeToSet, setDate, comToSet, alarmToSet);
Method in the DB helper class:
public void createAppointmentEntry(String nameApp, String typeApp, Time timeApp, Date dateApp ,String commentApp, Boolean onOrOff) {
ContentValues cv = new ContentValues();
cv.put(KEY_NAMEAPP, nameApp);
cv.put(KEY_TYPEAPP, typeApp);
cv.put(KEY_TIMEAPP, timeApp.toString());
cv.put(KEY_DATEAPP, dateApp.toString());
cv.put(KEY_COMMENTAPP, commentApp);
cv.put(KEY_ALARM, onOrOff);
ourDatabase.insert(DATABASE_TABLEAPP, null, cv);
In my app, the following output is showing how the date is stored:
Obviously this time format isnt correct. Can someone point me in the right direction of setting this as an actual time format.

Although Guilherme’s answer works, I’d say you can also use the Time#format() method to achieve proper formatting of your time. You pass off a String to the
format()method (eg"%x%X") formatted to specifications ofstrftime.
Eg
This is just a default locale-specific representation, you can set it to basically anything if you want a consistent time format.