Uipath Forms return forms data in a jason object.
Im trying to use Date/Time from Forms…
I have disable the Time from DateTime activity of Forms and I have changed the date formate to (dd.MM.yyyy)
output of json object showing that result.
The result is perfect except i have to split that so I do not take time.
When I read this Start and End date as
variable is string (strStartDate = jsonOutput(“StartDate”).ToString)
I get a result
And my question is why the jsonobject result and string result is different ?
jsonobject result is what i need so why its changing and how can i solv it.
that is the reason that i did formate change in DateTime jsonscript so that It wont give me wrong answer but still its changing when reading as string.
thanks if anyone can help
It’s probably because json keeps it as datetime type. You can try to deserialize json.
var jsonDate = new Date(1297246301973);
Then let’s convert it to js format:
var date = new Date(parseInt(jsonDate.substr(6)));
The substr() function takes out the /Date( part, and the parseInt() function gets the integer and ignores the )/ at the end. The resulting number is passed into the Date constructor .
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.