java获得当前时间

	Date now = new Date(); 
		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd HH:mm:ss");//可以方便地修改日期格式


		String hehe = dateFormat.format( now ); 
		System.out.println(hehe); 

在这里插入图片描述

原文地址:https://www.cnblogs.com/CCCrunner/p/11781629.html