fork 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.SimpleDateFormat;
  8. import java.text.ParseException;
  9. import java.util.Date;
  10.  
  11. /* Name of the class has to be "Main" only if the class is public. */
  12. class Ideone
  13. {
  14. public static void main (String[] args) throws java.lang.Exception
  15. {
  16. // your code goes here
  17. String str = "12 Jun 2016 13:02:17 +0300";
  18. DateFormat format = new SimpleDateFormat("EEEE dd MMM yyyy hh:mm:ss zzzz'");
  19. Date date = format.parse(str);
  20. System.out.println("HELLO world" + date.toString());
  21. }
  22. }
Runtime error #stdin #stdout #stderr 0.14s 321280KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Exception in thread "main" java.lang.IllegalArgumentException: Unterminated quote
	at java.text.SimpleDateFormat.compile(SimpleDateFormat.java:842)
	at java.text.SimpleDateFormat.initialize(SimpleDateFormat.java:634)
	at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:605)
	at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:580)
	at Ideone.main(Main.java:18)