fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3.  
  4. import java.text.DateFormat;
  5. import java.text.ParseException;
  6. import java.text.SimpleDateFormat;
  7. import java.util.*;
  8.  
  9. /* Name of the class has to be "Main" only if the class is public. */
  10. class Ideone
  11. {
  12. public static void main(String[] args) throws ParseException {
  13. String strDate="2013-07-21T10:31:00";
  14. DateFormat df=new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss");
  15. Date date=df.parse(strDate);
  16. df=new SimpleDateFormat("dd-MMM-yyyy");
  17. System.out.println(df.format(date));
  18. }
  19. }
Success #stdin #stdout 0.1s 380928KB
stdin
Standard input is empty
stdout
21-Jul-2013