Date nowDate = new Date();标签:DateUtil,满足条件,00,判断,String,getTime,formatted,nowDate,当前 From: https://www.cnblogs.com/yangjieboke/p/17925781.html
String formatted = DateUtil.format(nowDate, "yyyy-MM-dd");
String startTime=formatted+" 09:00:00";
DateTime parse1 = DateUtil.parse(startTime);
String endTime=formatted+" 16:00:00";
DateTime parse2 = DateUtil.parse(endTime);
//判断当前时间是否在9点到16点之间
if(nowDate.getTime()<parse1.getTime()){
return R.fail("您好,当前非工作时间不能提现!");
}
if(nowDate.getTime()>parse2.getTime()){
return R.fail("您好,当前非工作时间不能提现!");
}