1 Star 0 Fork 44

bing/Java学习1

forked from 西瓜998/Java学习1 
Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
Exam.java 540 Bytes
Copy Edit Raw Blame History
bing authored 2021-11-08 15:03 +08:00 . 常用实用类
import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
public class Exam{
public static void main(String[] args) {
// 现在
LocalDateTime date2 = LocalDateTime.now();
System.out.println(date2);
// 考研第一门开考时间
LocalDateTime date3 = LocalDateTime.of(2022, 12, 26, 8, 30, 0);
System.out.println(date3);
long hours = date2.until(date3, ChronoUnit.HOURS);
long min = date2.until(date3, ChronoUnit.MINUTES);
System.out.println("现在距离"+date3+"这一时刻还有:"+hours+"小时"+min+"分钟");
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/zlibing/java-learning-1.git
git@gitee.com:zlibing/java-learning-1.git
zlibing
java-learning-1
Java学习1
master

Search