fork download
  1.  
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6. import java.text.*;
  7.  
  8.  
  9. class Ideone
  10. {
  11. public static void main (String[] args) throws java.lang.Exception
  12. {
  13. String dateStr = "Mon Oct 05 00:00:00 GMT+03:00 2020";
  14.  
  15. DateFormat formatter = new SimpleDateFormat("E MMM dd HH:mm:ss Z yyyy");
  16. DateFormat formatter1 = new SimpleDateFormat("dd-MM-yyyy");
  17. System.out.println(formatter1.format(formatter.parse(dateStr)));
  18. }
  19. }
Success #stdin #stdout 0.13s 36504KB
stdin
Standard input is empty
stdout
04-10-2020