time calculations

I have two fields:

tijdvan (DATETIME) format HH:mm
tijdtm (DATETIME) format HH:mm

and a calculation: werktijd (DATETIME & STORED)
which contains:

return tijdtm - tijdvan;

If I fill in the two fieldsL tijdvan & tijdtm with for example: 16:30 and 17:00 nothing happens, I want the result 00:30.

What am I doing wrong?

return tijdtm - tijdvan;

try this: tijdm.getTime() - tijdvan.getTime()
(substraction in milliseconds)

However, your code (substracting Objects) should also work from JS 1.3
I’ll check with dev team why this doesn’t work.

That does’nt work!
It doesn’t mather what I fill in, it returns: 01-01-1970
???

Is there any other option, because we do a lot of time-calculations in our solutions!

did you format your calculationResult to HH:mm?

Yep it works
thanks