fork(1) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. Calendar c = Calendar.getInstance();
  13. c.set(Calendar.YEAR, 1970);
  14. c.set(Calendar.MONTH, 0);
  15. c.set(Calendar.DAY_OF_MONTH, 1);
  16.  
  17. c.add(Calendar.SECOND, 1499090900);
  18.  
  19. System.out.println(c.getTime().getTime()); // 1900年1月1日からのミリ秒
  20. System.out.println(c.getTime()); // Date型
  21.  
  22. }
  23. }
Success #stdin #stdout 0.06s 4575232KB
stdin
Standard input is empty
stdout
1499091092985
Mon Jul 03 14:11:32 GMT 2017