我可以得到毫秒的日期值从日期选择器? (自1970年以来价值毫秒)
问题描述:
我有一个datepicker D组;我需要得到的日期的毫秒值。 (自1970年以来价值毫秒)
i have a DatePicker d; and i need to get the miliseconds value of the date. (the miliseconds since 1970 value)
我该怎么办呢?
答
创建日历对象,并设置在日期选择器和today.getTimeInMillis(),日期和时间
Create a calender object and set the date and time from the date picker and today.getTimeInMillis().
onDateSet(...) {
Calendar c = Calendar.getInstance();
c.set(...);
long mills = c.getTimeInMillis();
}