on 01-08-2008 2:07 PM
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
Hi Nisha,
Date date=new Date(System.currentTimeMillis());
Format formatter = new SimpleDateFormat("mmddyyyy");
String s = formatter.format(date);
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
After writning the following code:
Date date=new Date(System.currentTimeMillis());
Format formatter = new SimpleDateFormat("mm/dd/yyyy");
* String s = formatter.format(date)*
String dateString =date.getMonth()"/"date.getDay()"/"date.getYear();
wdComponentAPI.getMessageManager().reportSuccess("Date "+ date);
*wdComponentAPI.getMessageManager().reportSuccess("DateSting: "+dateString);
*
it is giving the foloowing o/p
0/2/1008
thats is its not converinting it properly plzz help urgent.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.