Quick update to this popular old thread. This use case is now much easier to do, like in the example below:
Start Date: {formdate: YYYY-MM-DD; name=start}
End Date: {formdate: YYYY-MM-DD; name=end}
{days=datetimediff(start, end, "D");trim=right}
Difference is {=days} days
I have used the datetimediff function and formdate command.