Skip to Content
0
Former Member
Jan 08, 2008 at 02:07 PM

to diplay write date format in an input field

16 Views

I have written this code to get the curent date.

Date date=new Date(System.currentTimeMillis());

* //String dateString=date.toString();*

String dateString =date.getMonth()+"/";

String dateString1=date.getDay()+"/";

String dateString2=date.getYear()+"/";

wdComponentAPI.getMessageManager().reportSuccess("Date "+ date);

wdComponentAPI.getMessageManager().reportSuccess("DateSting:"+dateString);

wdComponentAPI.getMessageManager().reportSuccess("DateSting1:"+dateString1);

wdComponentAPI.getMessageManager().reportSuccess("DateSting2:"+dateString2);

I am getting this output:

date:2008-01-08

i want in mmddyyyy format

01-08-2008

plz help its giving default values

When we try to print separately