当前位置:网站首页>Date的after时间判断
Date的after时间判断
2022-04-23 14:08:00 【阿闰】
Date nd=new Date();
Date goServiceTime=DateUtil.stringToDate("2021-09-18"+" "+"16:00", DateUtil.DATE_TIME_FORMAT_TIME);//上门服务时间
Date dayend=DateUtil.additionDate(nd, 24);//+24
//当前时间+24》上门服务时间 则不能退
if(dayend.after(goServiceTime)) {
//after > before <
System.out.println("不能退");
}
public static Date stringToDate(String datestr, String dateformat) {
Date date = new Date();
SimpleDateFormat df = new SimpleDateFormat(dateformat);
try {
date = df.parse(datestr);
} catch (ParseException e) {
e.printStackTrace();
}
return date;
}
after >
before <
版权声明
本文为[阿闰]所创,转载请带上原文链接,感谢
https://blog.csdn.net/wasd986523/article/details/120350015
边栏推荐
猜你喜欢
HyperMotion云迁移完成阿里云专有云产品生态集成认证
squid代理
关于密匙传递的安全性和数字签名
Wechat applet initializes Bluetooth, searches nearby Bluetooth devices and connects designated Bluetooth (I)
Mock测试
星界边境Starbound创意工坊订阅的mod的存放路径
Installation and use of postman pit
POI operation word template replaces data and exports word
HyperBDR云容灾V3.2.1版本发布|支持更多云平台,新增监控告警功能
Three point positioning based on ibeacons (wechat applet)
随机推荐
关于NodeJS中JSON5的相关配置和使用
Some experience of using dialogfragment and anti stepping pit experience (getactivity and getdialog are empty, cancelable is invalid, etc.)
POI operation word template replaces data and exports word
利用json-server在本地创建服务器请求
Recyclerview advanced use (II) - simple implementation of vertical drag and drop sorting
快速安装mongodb
mysql 5.1升级到5.611
云容灾是什么意思?云容灾和传统容灾的区别?
Indoor and outdoor map switching (indoor three-point positioning based on ibeacons)
RobotFramework 之 项目框架
Pycharm连接远程服务器并实现远程调试
预览CSV文件
星界边境文本自动翻译机使用说明
服务器日志分析工具(识别,提取,合并,统计异常信息)
倒计时1天~2022云容灾产品线上发布会即将开始
VMware15Pro在Deepin系统里面挂载真机电脑硬盘
Idea控制台乱码解决
云迁移的六大场景
01-NIO基础之ByteBuffer和FileChannel
On the multi-level certificate based on OpenSSL, the issuance and management of multi-level Ca, and two-way authentication