规定的时间跟获取的系统时间相比较大小 返回规定的值
//获取的系统时间
SimpleDateFormat sdf = new SimpleDateFormat(" HH:mm:ss");
Date currTime = new Date(System.currentTimeMillis());
final String str = sdf.format(currTime);
//规定的时间
final String strAM = "09:30:00";
SimpleDateFormat sim = new SimpleDateFormat("HH:mm:ss");
try {
Date d1 = sim.parse(str);
Date d2 = sim.parse(strAM);
if (d1.getTime()<d2.getTime()) {
Toast.makeText(getApplicationContext(), "系统获取的时间小于规定时间", Toast.LENGTH_LONG).show();
}
else{
Toast.makeText(getApplicationContext(), "系统获取的时间大于规定时间", Toast.LENGTH_LONG).show();
}