java获得当前时间

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


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

在这里插入图片描述

posted @ 2019-04-18 16:59  Philtell  阅读(97)  评论(0编辑  收藏  举报