fork(3) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.text.*;
  5. import java.lang.*;
  6. import java.io.*;
  7.  
  8. /* Name of the class has to be "Main" only if the class is public. */
  9. class Ideone
  10. {
  11. public static void main (String[] args) throws java.lang.Exception
  12. {
  13. String string = "Tue Dec 30 14:28:38 CET 2014";
  14. try {
  15. new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", Locale.ENGLISH).parse(string);
  16. System.out.println("OK ENGLISH");
  17. } catch (Exception ex) {
  18. System.out.println("KO ENGLISH");
  19. }
  20.  
  21. try {
  22. new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", Locale.GERMAN).parse(string);
  23. System.out.println("OK GERMAN");
  24. } catch (Exception ex) {
  25. System.out.println("KO GERMAN");
  26. }
  27. }
  28. }
Success #stdin #stdout 0.11s 380864KB
stdin
Standard input is empty
stdout
OK ENGLISH
KO GERMAN