一小时的时间戳:3,600,000
一天的时间戳:86400000
一个月的时间戳:2592000000
一年的时间戳:31536000000
public static void main(String[] args) {
Date nowData = new Date(System.currentTimeMillis() );
String now = DateFormatUtils.format(nowData, "yyyy-MM-dd HH:mm:ss");
System.out.println("==============");
System.out.println("当前时间");
System.out.println(nowData);
System.out.println(now);
Date oneDayDate = new Date(System.currentTimeMillis() + 60*1000);
String oneDay = DateFormatUtils.format(oneDayDate, "yyyy-MM-dd HH:mm:ss");
System.out.println("==============");
System.out.println("一分钟后时间");
System.out.println(oneDayDate);
System.out.println(oneDay);
long time = 1000 *60* 60 * 24 * 365L;
Date oneYearDate = new Date(System.currentTimeMillis() +time);
String oneYear = DateFormatUtils.format(oneYearDate, "yyyy-MM-dd HH:mm:ss");
System.out.println("==============");
System.out.println("一年后时间");
System.out.println(oneYearDate);
System.out.println(oneYear);
Date c = new Date(System.currentTimeMillis() + 31536000000L);
String cS = DateFormatUtils.format(c, "yyyy-MM-dd HH:mm:ss");
System.out.println("==============");
System.out.println(c);
System.out.println(cS);
}