How can I convert 11022004 to 11/02/2004.
Date d=new SimpleDateFormat("ddMMyyyy").parse("11022004");
> How can I convert 11022004 to 11/02/2004.public String getFormatedDate (String inDate, String inFormat,String outFormat) throws ParseException {String outDate = "";SimpleDateFormat dtFormat = new SimpleDateFormat(inFormat); //"ddMMyyyy"try {Date date = dtFormat.parse(inDate);dtFormat.applyPattern(outFormat); //dd/MM/yyyyoutDate = dtFormat.format(date);}catch (ParseException pe) {System.err.println("Format for Entered date isincorrect");throw pe;}return outDate;}For formats, refer tojava.sun.com/.../SimpleDateFormat.html
i am a beginner in J2ME.I have a form but the user in unable to enter a avliddate in it.Plz help me.
can you tell me whether there is a Focus() type command in J2ME as is injavascript.if yes, then plz tell me the syntax.
If its fixed length, you could use something as simple as:String oldDate = "11022004";String newString = oldDate.substring(0, 2) + "/" +oldDate.substring(2, 4) + "/" + oldDate.substring(4);