package javaapplication1;
import java.util.Calendar;
public class JavaApplication1 {
public static void main(String[] args) {
Calendar now = Calendar.getInstance();
System.out.println("Today: " + (now.get(Calendar.MONTH) + 1) + "-"
+ now.get(Calendar.DATE)
+ "-"
+ now.get(Calendar.YEAR)
+ " "
+ now.get(Calendar.HOUR_OF_DAY)
+ ":"
+ now.get(Calendar.MINUTE)
+ ":"
+ now.get(Calendar.SECOND)
+ "."
+ now.get(Calendar.MILLISECOND)
);
}
}
/*
run:
Today: 10-19-2016 18:25:57.752
*/