Article - CS265559
"Amount" Parameter in "dateAdd" Services is of type NUMBER but acts as an INTEGER in ThingWorx
Modified: 25-Aug-2022
Applies To
- ThingWorx Platform 7.3 F000 to 9.3 SP3
Description
- Services dateAddMilliseconds, dateAddSeconds, etc. have parameter Amount using a Base Type NUMBER in ThingWorx
- Service runs properly and adds milliseconds, seconds... until a constant limit: 2147483647
- No error is triggered: Service runs and adds milliseconds, seconds... until that imposed limit:
- max 2147483647 milliseconds are added (~25days)
- max 2147483647 seconds are added (~68years)
- In addition to that, most appropriate Base Type for the Amount parameter should be LONG, because even when you provide a NUMBER with decimals, the decimals are ignored:
- dateAddYears will add only 1 year if Amount=1.5
This is a printer-friendly version of Article 265559 and may be out of date. For the latest version click CS265559