Java gets the current time plus the time after half an hour

public static void main(String[] args) {
		long currentTime = System.currentTimeMillis() ;
		currentTime +=30*60*1000;
		Date date=new Date(currentTime);
		SimpleDateFormat dateFormat = new SimpleDateFormat(
				"yyyy-MM-dd HH:mm:ss");
		System.out.println(dateFormat.format(date));
	}

 

Guess you like

Origin blog.csdn.net/weixin_41967600/article/details/100569470