on 10-18-2008 5:08 PM
Hi,
I have a table with one column as Date from and Date to
i set dates in these columns using the calender.
these two columns are import parameters of an rfc.
Now i need to send the data to my RFC import parameter in this format that is dd.MM.yyyy
but webdynpro automatically processs the input date given to
yyyy.mm.dd
and Rfc raises an error ie it needs date in dd.MM.yyyy
pls help me out how do i do it.
Hi,
try this,
Date date;
DateFormat formatter = new SimpleDateFormat("dd.MM.yyyy");
string dateString=formatter .format(<date from >);
date = (Date)formatter.parse(dateString);
pass the date to table date from,like do for date to also.
hope it helps you.
Regards,
ramesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would suggest you add test cases to test with different locale-s. I am not sure the RFC requires the date format always in dd.MM.yyyy. It again depends on similar server settings. To give a generic solution, you must dig in further or draw a scope on what to assume on the server locations and user profiles.
Easwar Ram
Hi,
Have a workaround on the following code, it will be the answer for your question. Here I used System Date and converted to required format like Monthname-Date-Year. You change the format and workaround (like dd,mm,yyyy). My NWDS is not working so I can not try here
try
{
long l = System.currentTimeMillis();
java.sql.Date dt = new java.sql.Date(l);
wdComponentAPI.getMessageManager().reportSuccess("Date: " + dt);
SimpleDateFormat g_objDateFormat = new SimpleDateFormat("MMMM dd, yyyy");
wdContext.currentContextElement().setAbc(g_objDateFormat.format(dt));
}
catch (NullPointerException e)
{
wdComponentAPI.getMessageManager().reportException(e.toString(), true);
}
Regards
Raghu
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 sample code link to format the date
http://javatechniques.com/blog/dateformat-and-simpledateformat-examples/
thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Create a simple type data type of date and in the format section specify the format that you need as DD/MM/YYYY and bind the context node with this dictionary type
Try this it will help you
Thanks & Regards
Padma N
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.