AndyC1000
asked on
Create folder with timestamp
Dear all,
I'm using FileWriter to create a file. I want to create a folder in the outputPath with the timestamp and write the file to this location.
I'm not sure how to go about this.
Thanks
I'm using FileWriter to create a file. I want to create a folder in the outputPath with the timestamp and write the file to this location.
I'm not sure how to go about this.
Thanks
String outputFilename = "result";
String outputPath = "output/";
Writer writer = new FileWriter(outputPath + outputFilename + i + ".csv", true);
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
There are actually more important considerations than readability: for instance, why would you want a folder with a timestamp as its name?
Are you putting more than one file into it? If so, then you're likely to need a coarser granularity than a timestamp with milliseconds or possibly even seconds (maybe even coarser)
Are you putting more than one file into it? If so, then you're likely to need a coarser granularity than a timestamp with milliseconds or possibly even seconds (maybe even coarser)
ASKER
The purpose of the folder is to store the date/time of the model run, I will need to record time down to seconds.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
:)
This would probably be more useful then a new directory with the millisecond in it. That is not very human readable for the future.
Hope that helps.