SyntaxFix
Write A Post
Hire A Developer
Questions
No need to get too complicated, try this one liner:
String fileName = new SimpleDateFormat("yyyyMMddHHmm'.txt'").format(new Date());