on 08-10-2006 7:43 AM
Hi
I have a strange problem regarding the time field i have value attribute of type time when i enter the value in input box bound to it. and in program when i use that time to convert it into string it automatically gets different value may be one hour before the entered value i am not changing the value any where so how its happening and how can we resolve the problem
bellow is the code i have used
SimpleDateFormat datePickerTime = new SimpleDateFormat("HH:mm:ss");
SimpleDateFormat abapTime = new SimpleDateFormat("HHmmss");
try
{
Date frmTime = datePickerTime.parse(wdContext.currentContextElement().getFromTimeValue().toString());
String frmTimeText = abapTime.format(frmTime);
wdContext.currentParametersElement().setFromTime(frmTimeText);
}
catch(Exception e)
{
wdContext.currentParametersElement().setFromTime("");
}
Thanks
Ninad
Message was edited by: Ninad
hi,
I checked it out. it has given the 24 hr time format value.can you illustrate your problem with some values?
regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In first post i had posted the code for changing the time and bellow is the code for changing date
SimpleDateFormat datePickerDate = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat abapDate = new SimpleDateFormat("yyyyMMdd");
try
{
Date frmDate = datePickerDate.parse(wdContext.currentContextElement().getFrmDateValue().toString());
String frmDateText = abapDate.format(frmDate);
wdContext.currentParametersElement().setFromDate(frmDateText);
}
catch(Exception e)
{
wdContext.currentParametersElement().setFromDate("");
}
please tell me what should i do to resolve this problem
Thanks
Ninad
Ninad,
i checked that again. but this time also it works fine.
yet i coudn't guess why it has not come to your appilication. you are using time attribute for first time field and string for second one.
like wise, using date attribute for the first date field and string for second one. correct?
then what is the use of Parameters node?
when i give input 09.08.2006 and i am converting the date in string in some and also in other format but i get the date 08.08.2006 and same case with time i get time 1 hour before. i want the same date and time should come in some other format
for that i have posted the code in above reply's you can refer that code.
Thanks
Ninad
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.