public class Demo01 {
@Test
public void test() {
Date now=new Date();
System.err.println(now);
System.out.print("");
int date=now.getDate();
System.out.println(date);
int mon=now.getMonth();
System.out.println(mon);//0,11代表1月,12月
int day=now.getDay();
System.out.println(day);
}
@Test
public void test1() {
long currentTimeMillis = System.currentTimeMillis();
Date now_10 = new Date(currentTimeMillis-1000*60*10);
System.out.println(now_10);
}
}
Java之Date简单测试
猜你喜欢
转载自blog.csdn.net/qq_34361514/article/details/81607487
今日推荐
周排行