Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import android.widget.TimePicker; public class Main { public static final long getValidTime(TimePicker timePicker) { Calendar c = Calendar.getInstance(); c.set(Calendar.HOUR_OF_DAY, timePicker.getCurrentHour().intValue()); c.set(Calendar.MINUTE, timePicker.getCurrentMinute().intValue()); return c.getTimeInMillis(); } }