DatePicker 1.获取一个日历对象: Calendar cal=Calendar.getInstance(); 2.获取当前日期及时间: int year=cal.get(Calendar.YEAR); int month=cal.get(Calendar.MONTH)+1;//特殊的是Calendar中月份从0开始计数,所以加1得到常规月份 int day=cal.get(Calendar.DAY_OF_MONTH); int hour=cal.get(Calendar.HOUR_OF…