Question

Under new Date(); it has an error. I want to place it as a file name.

Date date = new Date();

SimpleDateFormat dateFormat = new SimpleDateFormat("ddMMyyyyHHmmSS"); filename = dateFormat.format(date).concat(".jpg");

Was it helpful?

Solution

I hope that the following code will work fine.I tested it has no error. Date date = new Date(); SimpleDateFormat dateFormat = new SimpleDateFormat("ddMMyyyyHHmmSS"); String filename = dateFormat.format(date).concat(".jpg");

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top