cancel
Showing results for 
Search instead for 
Did you mean: 

Time field problem

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

hi,

I checked it out. it has given the 24 hr time format value.can you illustrate your problem with some values?

regards

Former Member
0 Kudos

Hi Karthikeyan

I am giving date value 09.08.2006 and get 08.08.2006 in another input field i accept time vale there i entered 12:30:00 and i got 11:30:00

so what could be the problem

Thanks

Ninad

Former Member
0 Kudos

Hi Ninad,

can you put the complete code here to get date and time in another field?

regards

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi

You give the input date as 2006-08-10 it is working.

What error message you got?

What your requirement?

Kind Regards

Mukesh

Former Member
0 Kudos

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?

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Karthikeyan,

I am using date type for entering date in the application and then converting it in to a string and same thing for time using time type in the application for accepting it from user and then converting it in to a string for next processing.

Thanks

Ninad

Former Member
0 Kudos

Hi Ninad,

i have created one application for this.

in first time field i gave time like 18:00:00 it convert the value to 12 hr format(6:00 pm) and the same value (18:00:00) had come in the second.

same as for Date field but it works good. No wrong answers.

regards

Former Member
0 Kudos

Hi Karthikeyan,

but the same code giving problem at my place so what could be the problem or is there any setting which i am missing.

Thanks

Ninad

Former Member
0 Kudos

hi Ninad,

what is the NWDS version and Web Application Server(WAS) you are using?

Former Member
0 Kudos

Hi

my WAS version is 6.40 and NWDS IS 2.0.9 what are your versions.

Former Member
0 Kudos

Hi Ninad,

we are using WAS 6.40 SP 15 and NWDS version SP15. but i dont think this date and time problem depends the version.

regards

karthik