Q:

Write a Java program to display the system time

0

Write a Java program to display the system time
Sample Output:

Current Date time: Fri Jun 16 14:17:40 IST 2017

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

public class Exercise46 {
  
  public static void main(String[] args){
         System.out.format("\nCurrent Date time: %tc%n\n", System.currentTimeMillis());
    }
}

Sample Output:

Current Date time: Fri Jun 16 14:17:40 IST 2017 

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now