fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4. import java.text.SimpleDateFormat;
  5.  
  6. /* Name of the class has to be "Main" only if the class is public. */
  7. class Ideone
  8. {
  9. public static void main (String[] args) throws java.lang.Exception
  10. {
  11. String dt = "20171004";
  12. SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
  13. Date target = sdf.parse(dt);
  14. System.out.println(target.toString());
  15. }
  16. }
Success #stdin #stdout 0.08s 4386816KB
stdin
Standard input is empty
stdout
Wed Oct 04 00:00:00 GMT 2017