I have Date and Time from DatePicker
and TimePicker
. Now i want to change the selected date and time into milliseconds. How can I do this???
For Example I have Date selected 2-5-2012
and Time is 20:43
Now I have to convert this Date Time into milliseconds something like
DateTimeInMilliseconds = 1234567890
You can create a Calendar object with the values from your DatePicker and TimePicker:
Calendar calendar = Calendar.getInstance(); calendar.set(datePicker.getYear(), datePicker.getMonth(), datePicker.getDayOfMonth(), timePicker.getCurrentHour(), timePicker.getCurrentMinute(), 0); long startTime = calendar.getTimeInMillis();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With