write current date

This is a very simple question for you but not for me...
I need to write the current date in a csv file, how can I reach the target??
out.write(???????????)
thx a lot for your answer

Fabio

PS:the perfect script is save the csv file with "current date.csv" like 20091129

You might want to refer to

You might want to refer to the Java documentation on SimpleDateFormat to alter the way this date is displayed, but here is a little function that I use:

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

// Function to generate the time
String getDateTime()
{
DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
Date date = new Date();
return dateFormat.format(date);
}

// Call the function
session.log(getDateTime());