vxh.viet
3/30/2016 - 3:56 AM

Current timestamp as filename in Java, Android

Current timestamp as filename in Java, Android

Source: StackOverflow

Question: How do I name the new files created with the current timestamp?

Answer:

String fileName = new SimpleDateFormat("yyyyMMddhhmm'.txt'").format(new Date());