Here you can find the source of getDateFromDatePicket(DatePicker datePicker)
Parameter | Description |
---|---|
datePicker | a parameter |
public static java.util.Date getDateFromDatePicket(DatePicker datePicker)
//package com.java2s; import java.util.Calendar; import android.widget.DatePicker; public class Main { /**//from w w w.j a va 2s .com * Get the date as milliseconds from a DatePicker * * @param datePicker * @return */ public static java.util.Date getDateFromDatePicket(DatePicker datePicker) { int day = datePicker.getDayOfMonth(); int month = datePicker.getMonth(); int year = datePicker.getYear(); Calendar calendar = Calendar.getInstance(); calendar.set(year, month, day); return calendar.getTime(); } }