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. import java.text.DateFormat;
  7. import java.text.ParseException;
  8. import java.text.SimpleDateFormat;
  9.  
  10. /* Name of the class has to be "Main" only if the class is public. */
  11. class Ideone
  12. {
  13.  
  14. static String date = "2015-09-17T08:22:49Z";
  15. public static DateFormat inputDatetimeFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
  16. public static DateFormat displayDateFormat = DateFormat.getDateTimeInstance();
  17.  
  18. public static void main (String[] args) throws java.lang.Exception
  19. {
  20. System.out.println(displayDateFormat.format(inputDatetimeFormatter.parse(date)));
  21. }
  22. }
Runtime error #stdin #stdout #stderr 0.15s 321408KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Exception in thread "main" java.text.ParseException: Unparseable date: "2015-09-17T08:22:49Z"
	at java.text.DateFormat.parse(DateFormat.java:366)
	at Ideone.main(Main.java:20)