fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4. import java.text.SimpleDateFormat;
  5. import java.util.Locale;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. String date = "January, 2015";
  13. SimpleDateFormat sdf = new SimpleDateFormat("MMMM, yyyy", Locale.ENGLISH);
  14. Date d = sdf.parse(date);
  15. System.out.println(date.toString());
  16. }
  17. }
Success #stdin #stdout 0.14s 320832KB
stdin
Standard input is empty
stdout
January, 2015