Need to insert current year????

Hi
Im trying to put the current year into an text file when I write it with data that I scrape. Im using interpretated Java.

Could u help me at all as Im not familiar at all with javascript.

Thanks, Kerri

Here is a function to use

Here is a function to use that will get the date/time for you:

import java.util.Date;
import java.text.DateFormat;
import java.text.SimpleDateFormat;

String getDateTime()
{
DateFormat dateFormat = new SimpleDateFormat("yyyy");
Date date = new Date();
return dateFormat.format(date);
}

You can edit that SimpleDateFormat to reflect what you want the date to show with instructions from here: http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html

And if you're using our Output to CSV from the script repository, when you create the filename, you just call that function like this:

outputFile = "file name_" + getDateTime() + ."csv";