当前位置:网站首页>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
边栏推荐
- Switch usage (wechat applet)
- 正则表达式
- Logback logger and root
- JDBC details
- JDBC和servlet写CRUD的接口总结
- ActiveMQ Basics
- Wechat applet communicates with low-power Bluetooth - receives data sent by hardware (IV)
- Wechat applet communicates with esp8266 based on UDP protocol
- Promtail + Loki + Grafana 日志监控系统搭建
- Use of WiFi module based on wechat applet
猜你喜欢
Pycharm连接远程服务器并实现远程调试
HyperMotion云迁移助力中国联通,青云完成某央企上云项目,加速该集团核心业务系统上云进程
MYSQL 主从同步避坑版教程
VMWare安装64位XP中文教程
MySQL数据库讲解(十)
Win10 comes with groove music, which can't play cue and ape files. It's a curvilinear way to save the country. It creates its own aimpack plug-in package, and aimp installs DSP plug-in
Three point positioning based on ibeacons (wechat applet)
DeepinV20安装Mariadb
使用Executors类快速创建线程池
About the configuration and use of json5 in nodejs
随机推荐
CDH cluster integration Phoenix based on CM management
拨开云雾synchronized使用五种方式介绍
HyperMotion云迁移助力中国联通,青云完成某央企上云项目,加速该集团核心业务系统上云进程
mysql 5.1升级到5.66
使用Postman进行Mock测试
困扰多年的系统调研问题有自动化采集工具了,还是开源免费的
线程组ThreadGroup使用介绍+自定义线程工厂类实现ThreadFactory接口
Wechat applet communicates with esp8266 based on UDP protocol
jsp学习1
RobotFramework 之 项目框架
帆软中单元格中隔行变色以及数量大于100字体变大变红设置
Gartner预测云迁移规模大幅增长;云迁移的优势是什么?
ActiveMq基础知识
帆软报表设置单元格填报以及根据值的大小进行排名方法
关于云容灾,你需要知道这些
RobotFramework 之 公共变量
帆软调用动态传参的方法,在标题中设置参数
关于密匙传递的安全性和数字签名
帆软中需要设置合计值为0时,一整行都不显示的解决办法
帆软之单元格部分字体变颜色