Fetching date format from file to append to a filename in Android
How can I get DateFormat MM-dd-yyyy hh:mm:ss to save my photos name?
fileOutputStream = new FileOutputStream("/sdcard/CameraExample/" ...
开发者_Go百科
Time t = new Time();
t.setToNow();
String session = t.format("%D %T")) //Strftime format
File f = Environment.getExternalStorageDirectory();
String fullfilename = f.getAbsoluteFile() + "/Android/data/Photos/" ;
File fileToWrite_data = new File(fullfilename,session + "_Data.txt");
FileOutputStream fos_data = new FileOutputStream(fileToWrite_data,true);
http://php.net/manual/en/function.strftime.php
精彩评论