这主要适用于android,但可以在Java中使用。我有这些听众:
int year, month, day, hour, minute;
// the callback received when the user "sets" the date in the dialog
private DatePickerDialog.OnDateSetListener mDateSetListener =
new DatePickerDialog.OnDateSetListener() {
public void onDateSet(DatePicker view, int year,
int monthOfYear, int dayOfMonth) {
year = year;
month = monthOfYear;
day = dayOfMonth;
}
};
// the callback received when the user "sets" the time in the dialog
private TimePickerDialog.OnTimeSetListener mTimeSetListener =
new TimePickerDialog.OnTimeSetListener() {
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
hour = hourOfDay;
minute = minute;
}
};
我怎样才能转换int year, month, day, hour, minute;
为 unix 时间戳?Date
没有课程这可能吗?