You can use a web viewer and get the duration using JavaScript code.
You can also build a Google Apps Script code and deploy it so you can use it as web API.
Thunkable X is open code in this regards so you can choose many other ways to get the calculations.
See this post which I explained an example of how to get the date after number of days (added or subtracted).