java - Convert Mon/yyyy to a date -


i have date in string format jun/2014. want convert date. ok have day date.

how achieve this? tried following code did not work.

  string fromdate="jun/2014";   simpledateformat  format = new simpledateformat("mm/yyyy");      string date = format.format(fromdate);   

you should try

        string fromdate = "jun/2014";     simpledateformat format = new simpledateformat("mmm/yyyy");     date date = null;     try {         date = format.parse(fromdate);     } catch (parseexception e) {         // todo auto-generated catch block         e.printstacktrace();     }     system.out.println(date); 

your result : sun jun 01 00:00:00 ect 2014


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -