To get the current date and time as a string in Java 1.4, you can use java.text.SimpleDateFormat to convert dates and times into any string format.
Date currentDate = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd-HH:mm:ss");
String currentDateTime = sdf.format(currentDate);
// You can get a string like 2012-11-06-02:20:45
That’s all from the Gemba.