package com.java.page;
import java.text.SimpleDateFormat;
import java.util.Date;
public class Student {
public static void main(String args[])throws Exception{
Date date=new Date();
SimpleDateFormat sdf=new SimpleDateFormat("yyyy:MM:dd HH:mm:ss");
String ding="2011:05:29 21:52:00";
Date show=sdf.parse(ding);
if((date.getTime()-show.getTime())>120000){
System.out.println("现在大");
}else{
System.out.println("现在小");
}
}
}
Java 时间相减
最新推荐文章于 2024-07-17 16:57:10 发布