当前位置:网站首页>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
边栏推荐
- Grep was unable to redirect to the file
- Sqlserver transaction and lock problem
- win10 任务栏通知区图标不见了
- 中富金石财富班29800效果如何?与专业投资者同行让投资更简单
- LeetCode167-两数之和II-双指针-二分-数组-查找
- Async void caused the program to crash
- How to use OCR in 5 minutes
- Ffmpeg installation error: NASM / yasm not found or too old Use --disable-x86asm for a clipped build
- kubernetes之常用Pod控制器的使用
- Llvm - generate addition
猜你喜欢
Detailed comparison between asemi three-phase rectifier bridge and single-phase rectifier bridge
API gateway / API gateway (II) - use of Kong - load balancing
About UDP receiving ICMP port unreachable
UML learning_ Day2
LeetCode 练习——396. 旋转函数
Detailed explanation of C language knowledge points -- first understanding of C language [1] - vs2022 debugging skills and code practice [1]
LeetCode167-两数之和II-双指针-二分-数组-查找
Mds55-16-asemi rectifier module mds55-16
LeetCode165-比较版本号-双指针-字符串
Share 20 tips for ES6 that should not be missed
随机推荐
Leetcode151 - invert words in string - String - simulation
eolink 如何助力遠程辦公
Design of digital temperature monitoring and alarm system based on DS18B20 single chip microcomputer [LCD1602 display + Proteus simulation + C program + paper + key setting, etc.]
8.3 language model and data set
The wechat applet optimizes the native request through the promise of ES6
Basic operation of circular queue (Experiment)
What is the role of the full connection layer?
SQLSERVER事物与锁的问题
Differential privacy (background)
MySQL installation process (steps for successful installation)
Detailed explanation of C language knowledge points -- first understanding of C language [1] - vs2022 debugging skills and code practice [1]
Daily question - leetcode396 - rotation function - recursion
我的 Raspberry Pi Zero 2W 折腾笔记,记录一些遇到的问题和解决办法
tcp_ Diag kernel related implementation 1 call hierarchy
调度系统使用注意事项
Modify the default listening IP of firebase emulators
Thinkphp5 + data large screen display effect
LeetCode153-寻找旋转排序数组中的最小值-数组-二分查找
SQL中HAVING和WHERE的区别
8.4 realization of recurrent neural network from zero