android之获取系统时间并作为文件名

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);

猜你喜欢

转载自yingang-1982.iteye.com/blog/2019590