fork(3) download
  1. import java.text.*;
  2. import java.util.Date;
  3.  
  4. class Ideone
  5. {
  6. public static void main (String[] args) throws java.lang.Exception
  7. {
  8. DateFormat format = new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy Z");
  9. String s = "Tue Dec 22 19:16:57 2015 UTC";
  10. s = s.replace("UTC", "GMT");
  11. Date d = format.parse(s);
  12. System.out.println(d.toString());
  13. }
  14. }
Success #stdin #stdout 0.14s 321472KB
stdin
Standard input is empty
stdout
Tue Dec 22 19:16:57 GMT 2015