Answer
Before adding extra script-task reformatting, check whether the API task itself already accepts one of the workflow engine's directly-supported date/datetime string formats — if your value already matches one of those accepted patterns, you can pass it straight into the API task without a separate conversion step. See passing a timestamp value into an IFS API call.