//
导入
import java.util.Date;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
Date dt = new Date(); // 如果不需要格式,可直接用dt,dt就是当前系统时间
DateFormat df = new SimpleDateFormat( " yyyy/MM/dd HH:mm:ss " ); // 设置显示格式
String nowTime = "" ;
nowTime = df.format(dt); // 用DateFormat的format()方法在dt中获取并以yyyy/MM/dd HH:mm:ss格式显示
import java.util.Date;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
Date dt = new Date(); // 如果不需要格式,可直接用dt,dt就是当前系统时间
DateFormat df = new SimpleDateFormat( " yyyy/MM/dd HH:mm:ss " ); // 设置显示格式
String nowTime = "" ;
nowTime = df.format(dt); // 用DateFormat的format()方法在dt中获取并以yyyy/MM/dd HH:mm:ss格式显示