fork 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 cal = Calendar.getInstance();
  13. cal.setTime(new Date(1400898254092L));
  14.  
  15. int year = cal.get(Calendar.YEAR);
  16. int month = cal.get(Calendar.MONTH) + 1;
  17. int day = cal.get(Calendar.DAY_OF_MONTH);
  18. int hour = cal.get(Calendar.HOUR);
  19. int minute = cal.get(Calendar.MINUTE);
  20.  
  21. System.out.println(day+"-"+month+"-"+year+" "+hour+":"+minute);
  22. }
  23. }
Success #stdin #stdout 0.09s 380480KB
stdin
Standard input is empty
stdout
24-5-2014 2:24