cancel
Showing results for 
Search instead for 
Did you mean: 

Web Services Date Errors

Former Member
0 Kudos

hi, recently i code a web service as below

public boolean createNew(String staffID,

Date startDate,

Date endDate){

<code to add to database>

return true

}

but the problem is when i try to consume the web service

it will auto fill the startDate and endDate with this data

startDate: "2008-01-30T10:00:50.342Z"

endDate: "2008-01-30T10:00:50.342Z"

so may i know issit possible to change it to just only accept 2008-01-30? or as this format YYYY-MM-DD.

or i should not use Date for startDate and endDate?

Regard

Jia Jun

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member197348
Active Contributor
0 Kudos

Hi,

Create date passing String in format yyyy-mm-dd.

Date startDate= new Date("yyyy-mm-dd");

Date endDate= new Date("yyyy-mm-dd");

public boolean createNew(String staffID,

startDate,

endDate){

<code to add to database>

return true

}

regards,

Siva

Former Member
0 Kudos

Hi Siva

but the problem is my parameter i pass in from my adobe form is using Date format (YYYY-MM-DD)

that why i wonder is there anyway beside that

former_member197348
Active Contributor
0 Kudos

Hi Jia,

Try if it is OK for you. convert the Date to String. Take the substring of first 10 characters.

regards,

Siva

Former Member
0 Kudos

Hi Siva,

may i know how to do it?

as i did try to code in the begining by using String for my startDate and endDate. and it is able to consume, but currently if i change the startDate and endDate to Date. it is still able to consume when i change the date from "2008-01-30T10:00:50.342Z" to just "2008-01-30". but when i try to use adobe interactive form. the startDate and endDate i am using the Date/Time Field Type. and the Data Format is as Date. so it will just return "2008-01-30" only.

the part where i have error is when i try to do a parameter mapping from the interactive form to the web service. it is unable to map as they keep prompting that cannot map a Date to a Time Stamp.

that is why i stuck at this part.. so i try to find out how to overcome this errors now..

Regards

Jia Jun