开发者

Fetching date format from file to append to a filename in Android

开发者 https://www.devze.com 2023-03-15 21:23 出处:网络
How can I get DateFormat MM-dd-yyyy hh:mm:ss to save my photos name? fileOutputStream = new FileOutputStream(\"/sdcard/CameraExample/\" ...

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

精彩评论

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

关注公众号