有时候需要我们获取系统的时间来作为文件名
这里就简单写一下好啦
SimpleDateFormat timesdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//SimpleDateFormat filesdf = new SimpleDateFormat("yyyy-MM-dd HHmmss"); //文件名不能有:
String FileTime =timesdf.format(new Date()).toString();//获取系统时间
String filename = FileTime.replace(":", "");
MyTextView.setText("Time = "+FileTime+"\nfile"+filename);
因为文件名不能有:冒号,所以简单的替换一下,把冒号去掉