当前位置:网站首页>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
边栏推荐
- Leetcode153 - find the minimum value in the rotation sort array - array - binary search
- Subnet division of flannel principle
- Async void caused the program to crash
- Leetcode exercise - 396 Rotation function
- 我的树莓派 Raspberry Pi Zero 2W 折腾笔记,记录一些遇到的问题和解决办法
- Share 20 tips for ES6 that should not be missed
- Llvm - generate local variables
- 脏读、不可重复读和幻读介绍
- API gateway / API gateway (III) - use of Kong - current limiting rate limiting (redis)
- How to design a good API interface?
猜你喜欢
LeetCode153-寻找旋转排序数组中的最小值-数组-二分查找
如何设计一个良好的API接口?
Have you really learned the operation of sequence table?
About UDP receiving ICMP port unreachable
Is asemi ultrafast recovery diode interchangeable with Schottky diode
Explanation and example application of the principle of logistic regression in machine learning
LeetCode 练习——396. 旋转函数
Five data types of redis
Krpano panorama vtour folder and tour
Tun equipment principle
随机推荐
Comment eolink facilite le télétravail
Grep was unable to redirect to the file
Thinkphp5 + data large screen display effect
8.4 realization of recurrent neural network from zero
Share 3 tools, edit 5 works at home and earn more than 400
脏读、不可重复读和幻读介绍
C语言超全学习路线(收藏让你少走弯路)
Baidu written test 2022.4.12 + programming topic: simple integer problem
Is asemi ultrafast recovery diode interchangeable with Schottky diode
Leetcode167 - sum of two numbers II - double pointer - bisection - array - Search
Llvm - generate addition
Reptile exercises (1)
Introduction to dirty reading, unrepeatable reading and phantom reading
Introduction to distributed transaction Seata
如何设计一个良好的API接口?
API gateway / API gateway (III) - use of Kong - current limiting rate limiting (redis)
免费在upic中设置OneDrive或Google Drive作为图床
C language super complete learning route (collection allows you to avoid detours)
【thymeleaf】处理空值和使用安全操作符
Krpano panorama vtour folder and tour