fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.io.*;
  4. import java.sql.Timestamp;
  5. import java.util.ArrayList;
  6. import java.util.Arrays;
  7. import java.util.Date;
  8.  
  9. /* Name of the class has to be "Main" only if the class is public. */
  10. class Ideone
  11. {
  12. public static void main (String[] args) throws java.lang.Exception
  13. {
  14. //BufferedReader r = new BufferedReader (new InputStreamReader (System.in));
  15. //String s;
  16. //while (!(s=r.readLine()).startsWith("42")) System.out.println(s);
  17.  
  18. Date newDt = new Date();
  19. System.out.println(newDt);
  20. System.out.println(newDt.getTime());
  21. System.out.println(new Timestamp(newDt.getTime()));
  22. }
  23. }
Success #stdin #stdout 0.14s 57088KB
stdin
1
2
10
42
11
stdout
Thu Nov 14 07:33:12 GMT 2024
1731569592518
2024-11-14 07:33:12.518