当前位置:网站首页>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
边栏推荐
- Leetcode149 - maximum number of points on a line - Math - hash table
- C language super complete learning route (collection allows you to avoid detours)
- Grep was unable to redirect to the file
- T2 iCloud日历无法同步
- 分享 20 个不容错过的 ES6 的技巧
- Error: unable to find remote key "17f718f726"“
- async关键字
- Leetcode exercise - 396 Rotation function
- Async void caused the program to crash
- 机器学习——逻辑回归
猜你喜欢

每日一题-LeetCode396-旋转函数-递推

机器学习——逻辑回归

Five data types of redis

LeetCode 练习——396. 旋转函数

asp. Net method of sending mail using mailmessage

What is the role of the full connection layer?

Leetcode165 compare version number double pointer string

LeetCode153-寻找旋转排序数组中的最小值-数组-二分查找

Brute force of DVWA low -- > High

Comment eolink facilite le télétravail
随机推荐
like和regexp差别
How to upload large files quickly?
T2 iCloud日历无法同步
中富金石财富班29800效果如何?与专业投资者同行让投资更简单
Leetcode149 - maximum number of points on a line - Math - hash table
Llvm - generate if else and pH
Leetcode exercise - 396 Rotation function
Llvm - generate addition
Sword finger offer (1) -- for Huawei
LeetCode167-两数之和II-双指针-二分-数组-查找
UML learning_ Day2
Llvm - generate local variables
22年了你还不知道文件包含漏洞?
Difference between like and regexp
Example of time complexity calculation
Role of asemi rectifier module mdq100-16 in intelligent switching power supply
SQL中HAVING和WHERE的区别
牛客网数据库SQL实战详细剖析(26-30)
On the day of entry, I cried (mushroom street was laid off and fought for seven months to win the offer)
Five data types of redis