Function return error
Function return error
Hi,
I have written a function to convert the contents of two fields in to a date-time field.
- The field called CMISDate (dd-mm-yyy hh:mm:ss) always has the hh:mm:ss set to 00:00:00 as that is the format I import from my clients XLS file
- Another import field called Time (text) format. This will contain a time such as 14:00.
My function aims to take the CMISDate and convert to a string, split off the prefix at the [SPACE] and then append a [SPACE] + Time + ":00" to create a string variable that matches the (dd-mm-yyy hh:mm:ss) format.
Lastly I convert this back to a DATE-TIME type using .toTime()
I cannot seem to get the return I want as the function is adding .0 to the return??
CODE:
-----------
date dateutilites.setDates(date CMISDate, string Time)
{
x = input.CMISDate.toString();
xy = x.getPrefix(" ");
y = xy + " " + input.Time + ":00";
z = y.toTime();
return z;
}
see image attachment.
Thanks
Mark