on 05-29-2008 8:16 PM
Hi All
I am unable to get date in yyyy.MM.dd format.
I tried everything said in the previous postiongs.Nothig seem to work.
I am getting date in yyyy-MM-dd
This needs to be changed in said format. Also datatype should be date only.
Regards
Pratyush
You can solve the problem in two ways
First way;
Format formatter = new SimpleDateFormat("yyyy.MM.dd");
String s = formatter.format(date);
OR
Assuming your context attribute name is Date
IWDAttributeInfo attributeInfo = wdContext.getNodeInfo().getAttribute("Date");
attributeInfo.getDataAttribute().getScalarType().format("yyyy.MM.dd");
Second way;
By changing the default Language of your browser. You have to check the format of each language and choose the language that gives the date in yyyy.MM.dd format.
Rgs,
Dni
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks all for reply.
Actually I tried both it did not worked.
simple type should work but it didnt.
Also since I need data in date format only.
parse cant be used. Since string converted back had different format.
I requested people to make appropiate change in RFC.
It works now.
Regards
Pratyush
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
use this
Format formatter = new SimpleDateFormat("yyyy.MM.dd");
Calendar cal= Calendar.getInstance();
String s = formatter.format(cal.getTime());
System.out.println(s);
Regards
Trilochan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pratyush,
Use this...
Format formatter = new SimpleDateFormat("yyyy.MM.dd");
String s = formatter.format(date);
Regards,
Srinivas.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Pratyush,
Create a Simple Type in Dictionary with "Build-In Type" as "date". Goto the tab "Representation" and enter "yyyy.MM.dd" for "Format". Use this datatype for your context variable. When this variable is displayed, it will be in required format.
Cheers,
~kranthi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.