当前位置:网站首页>After time judgment of date
After time judgment of date
2022-04-23 15:14:00 【A run】
Date nd=new Date();
Date goServiceTime=DateUtil.stringToDate("2021-09-18"+" "+"16:00", DateUtil.DATE_TIME_FORMAT_TIME);// Door to door service time
Date dayend=DateUtil.additionDate(nd, 24);//+24
// current time +24》 Door to door service time You cannot return
if(dayend.after(goServiceTime)) {
//after > before <
System.out.println(" You can't go back ");
}
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 <
版权声明
本文为[A run]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231407312819.html
边栏推荐
- Detailed analysis of SQL combat of Niuke database (26-30)
- How to write the keywords in the cover and title? As we media, why is there no video playback
- About UDP receiving ICMP port unreachable
- Advanced version of array simulation queue - ring queue (real queuing)
- PSYNC synchronization of redis source code analysis
- JUC学习记录(2022.4.22)
- Tun model of flannel principle
- asp. Net method of sending mail using mailmessage
- Pnpm installation and use
- Thinkphp5 + data large screen display effect
猜你喜欢
函数(第一部分)
Kubernetes详解(九)——资源配置清单创建Pod实战
Leetcode167 - sum of two numbers II - double pointer - bisection - array - Search
我的 Raspberry Pi Zero 2W 折腾笔记,记录一些遇到的问题和解决办法
分布式事务Seata介绍
Nuxt project: Global get process Env information
thinkphp5+数据大屏展示效果
如何设计一个良好的API接口?
The win10 taskbar notification area icon is missing
22年了你还不知道文件包含漏洞?
随机推荐
Leetcode exercise - 396 Rotation function
Daily question - leetcode396 - rotation function - recursion
Leetcode153 - find the minimum value in the rotation sort array - array - binary search
免费在upic中设置OneDrive或Google Drive作为图床
Mds55-16-asemi rectifier module mds55-16
Kubernetes详解(十一)——标签与标签选择器
LeetCode153-寻找旋转排序数组中的最小值-数组-二分查找
[thymeleaf] handle null values and use safe operators
asp. Net method of sending mail using mailmessage
adobe illustrator 菜單中英文對照
js——實現點擊複制功能
Openfaas practice 4: template operation
Flink DataStream 类型系统 TypeInformation
分享3个使用工具,在家剪辑5个作品挣了400多
kubernetes之常用Pod控制器的使用
Reptile exercises (1)
Three uses of kprobe
Sword finger offer (1) -- for Huawei
Advanced version of array simulation queue - ring queue (real queuing)
C language super complete learning route (collection allows you to avoid detours)