Code:
Import the java.text.SimpleDateFormat; Import java.util.Date; // get the current time (years ~ ms) public class the getTime { public static void main (String [] args) { the SimpleDateFormat DATE = new new the SimpleDateFormat ( "YYYY, MM month dd day: HH: mm: ss --- SSS ( ms) " ); String the format = date.format ( new new a date (System.currentTimeMillis ())); System.out.println ( " current time: "+ the format) ; } }
operation result:
Current Time: April 24, 2019: 09:02: 09 --- 302 (ms)