java me - How to create a field of format dd/yyyy? -


the field datefield instead value month , year '05/2011' : how create such field ?

in java-me, can use java.util.calendar package formatting date.

here snippet tutorial on displaying date , time in java me:

private void outputdateusingcalendar(date date) {    calendar calendar = calendar.getinstance();    calendar.settime(date);    stringbuffer sb = new stringbuffer();     int day = calendar.get(calendar.day_of_month);    sb.append(numbertostring(day));    sb.append("-");    int month = calendar.get(calendar.month) + 1;    sb.append(numbertostring(month));    sb.append("-");    sb.append(calendar.get(calendar.year));     stringitem item = new stringitem("using calendar", sb.tostring());    mainform.append(item); } 

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -