import java.util.*;
public class xl{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println(“请输入日期时间格式为:xxxx年xx月xx日 xx时xx分xx秒”);
String str = input.nextLine();
if (!fang3(str)) {
System.out.println(fang3(str));
} else {
if (!fang(str)) {
System.out.println(fang(str));
} else if (!fang2(str)) {
System.out.println(fang2(str));
} else {
int year = Integer.parseInt(str.substring(0, 4));
int month = Integer.parseInt(str.substring(5, 7));
int ri = Integer.parseInt(str.substring(8, 10));
int h = Integer.parseInt(str.substring(12, 14));
int min = Integer.parseInt(str.substring(15, 17));
int s = Integer.parseInt(str.substring(18, 20));
boolean flag = true;
if (year < 0 || month
java计算两天之间的天数 (前闭后开)
最新推荐文章于 2024-02-19 10:33:26 发布