当前位置:网站首页>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
边栏推荐
- kubernetes之常用Pod控制器的使用
- Analysis of common storage types and FTP active and passive modes
- 我的 Raspberry Pi Zero 2W 折腾笔记,记录一些遇到的问题和解决办法
- Mysql连接查询详解
- Introduction to dirty reading, unrepeatable reading and phantom reading
- Byte interview programming question: the minimum number of K
- Tencent has written a few words, Ali has written them all for a month
- 1990年1月1日是星期一,定义函数date_to_week(year,month,day),实现功能输入年月日后返回星期几,例如date_to_week(2020,11,1),返回:星期日。 提示:
- win10 任务栏通知区图标不见了
- 脏读、不可重复读和幻读介绍
猜你喜欢
Share 20 tips for ES6 that should not be missed
The win10 taskbar notification area icon is missing
Detailed comparison between asemi three-phase rectifier bridge and single-phase rectifier bridge
win10 任务栏通知区图标不见了
Lotus DB design and Implementation - 1 Basic Concepts
Reptile exercises (1)
thinkphp5+数据大屏展示效果
Byte interview programming question: the minimum number of K
深度学习——超参数设置
Basic operation of circular queue (Experiment)
随机推荐
C语言超全学习路线(收藏让你少走弯路)
LeetCode151-颠倒字符串中的单词-字符串-模拟
Unity_ Code mode add binding button click event
UML学习_day2
机器学习——逻辑回归
The wechat applet optimizes the native request through the promise of ES6
免费在upic中设置OneDrive或Google Drive作为图床
Kubernetes详解(十一)——标签与标签选择器
win10 任务栏通知区图标不见了
函数(第一部分)
Share 20 tips for ES6 that should not be missed
API gateway / API gateway (II) - use of Kong - load balancing
MySQL Basics
填充每个节点的下一个右侧节点指针 II [经典层次遍历 | 视为链表 ]
Llvm - generate for loop
Set onedrive or Google drive as a drawing bed in upic for free
Fill in the next right node pointer II of each node [classical hierarchy traversal | regarded as linked list]
About UDP receiving ICMP port unreachable
LeetCode165-比较版本号-双指针-字符串
分享3个使用工具,在家剪辑5个作品挣了400多