How to outWrite current T/D stamp to a field in a record being written to disk?

Using interpreted JAVA
Dunno how to generate current time/date. I would like to write something like "2010-07-13 22:14:59P" to a field in a record. Here's the code I am now using to write data to text file...

// Write out the data to the file.
out.write( dataRecord.get( "RANK_PIN" ) + "\t" );
out.write( dataRecord.get( "BNAME" ) + "\t" );
out.write( "notes here" + "\t" );
out.write( dataRecord.get( "ADDRESS" ) + "\t" );
out.write( dataRecord.get( "CITY" ) + "\t" );
out.write( "NC" + "\t" );
out.write( dataRecord.get( "BZIP" ) + "\t" );
out.write( dataRecord.get( "BPHONE" ) + "\t" );
out.write( dataRecord.get( "BURL" ) + "\t" );
out.write( dataRecord.get( "BLAT" ) + "\t" );
out.write( dataRecord.get( "BLONG" ) + "\t" );
out.write( session.getVariable("CATEGORY") + "\t" );
==> WOULD LIKE TO WRITE T/D STAMP IN ABOVE FORMAT TO A FIELD RIGHT HERE <==
out.write( "\n" );

// Close up the file.
out.close();
}
catch( Exception e )
{
session.log( "An error occurred while writing the data to a file: " + e.getMessage() );
}

If you think you can help, pls post the code here. Offline, I can be reached at gageasebrkr [at] [gmail] [dot] [com]. Thx.

Add this to the top of your

Add this to the top of your script:

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

String getDateTime()
{
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-d HH:mm:ss");
Date date = new Date();
return dateFormat.format(date);
}

Then on that line where you want to write the date:

out.write(getDateTime());