当前位置:网站首页>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
边栏推荐
- Mds55-16-asemi rectifier module mds55-16
- Baidu written test 2022.4.12 + programming topic: simple integer problem
- SQLSERVER事物与锁的问题
- Explanation and example application of the principle of logistic regression in machine learning
- Error: unable to find remote key "17f718f726"“
- 分享3个使用工具,在家剪辑5个作品挣了400多
- Advanced version of array simulation queue - ring queue (real queuing)
- Leetcode exercise - 396 Rotation function
- LeetCode165-比较版本号-双指针-字符串
- Openfaas practice 4: template operation
猜你喜欢
22年了你还不知道文件包含漏洞?
Kubernetes详解(十一)——标签与标签选择器
UML学习_day2
LeetCode149-直线上最多的点数-数学-哈希表
How does eolink help telecommuting
Comment eolink facilite le télétravail
LeetCode165-比较版本号-双指针-字符串
Krpano panorama vtour folder and tour
Thinkphp5 + data large screen display effect
Have you really learned the operation of sequence table?
随机推荐
Detailed analysis of SQL combat of Niuke database (26-30)
API gateway / API gateway (II) - use of Kong - load balancing
MySQL Basics
Leetcode162 - find peak - dichotomy - array
Will golang share data with fragment append
Set onedrive or Google drive as a drawing bed in upic for free
Detailed explanation of C language knowledge points -- data types and variables [1] - carry counting system
Tun equipment principle
[thymeleaf] handle null values and use safe operators
Grep was unable to redirect to the file
Explanation and example application of the principle of logistic regression in machine learning
ffmpeg安装遇错:nasm/yasm not found or too old. Use --disable-x86asm for a crippled build.
js——實現點擊複制功能
X509 certificate cer format to PEM format
thinkphp5+数据大屏展示效果
LeetCode151-颠倒字符串中的单词-字符串-模拟
Baidu written test 2022.4.12 + programming topic: simple integer problem
UML learning_ Day2
每日一题-LeetCode396-旋转函数-递推
LeetCode153-寻找旋转排序数组中的最小值-数组-二分查找