开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜