I am trying to get the System
date and time and use that in the setFile()
method to prevent overwriting my output files. Any idea how I can do that? I went down the path of Calendar.YEAR
, etc. but that will give me model date and time not System. Any suggestions on how to proceed.
You can easily create a String of your current system time using:
Date currentDate = new Date(System.currentTimeMillis());
String dateAsString = currentDate.toString();
Use that in your setFile()
method for the filename and you will never overwrite any outputs (unless you ran them in the same exact second :-) ).