// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.text.DateFormat;
import java.text.SimpleDateFormat;

public class TheSplit {
    private static DateFormat df = new SimpleDateFormat("dd/MM/YYYY HH:mm:ss");
    public static void main(String[] args) {
        Date d; // point in time
        Calendar cal; // functionality to break up time in YMDHMS parts
        d = new Date();
        cal = new GregorianCalendar();
        cal.setTime(d);
        System.out.printf("%02d/%02d/%04d %02d:%02d:%02d\n", cal.get(Calendar.DAY_OF_MONTH), 1 + cal.get(Calendar.MONTH), cal.get(Calendar.YEAR), cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE), cal.get(Calendar.SECOND));
        System.out.printf("%s\n", df.format(d));
    }
}
