I want to create a file and use project name and date in the filename. Here is a simple Java code I used for a while on my Unix machine.
String fileName = projectName + "," + (date.toString());
PrintStream pr = new PrintStream(new File(fileName));
Recently, I tried to run my code on a Windows machine and I got this error:
Exception in thread "main" java.io.FileNotFoundException: Test,Thu Sep 03 12:28:33 EDT 2015 (The filename, directory name, or volume label syntax is incorrect)
When I remove the date from the filename, everything works perfect. Any suggestion what is the problem of date in filename and how I can fix it?