Relative date between two given dates, not now - native tiddlywiki

I have the same question. I can almost see a solution if there was a date format/template for rendering a date as Unix epoch/timestamp (seconds since 1970).

Then we could do this:

<$let
	start={{{ [<currentTiddler>get[start-date]format:date[TOKEN]] }}}
	end={{{ [<currentTiddler>get[end-date]format:date[TOKEN]] }}}
	diff={{{ [<end>subtract<start>divide[86400]fixed[0]] }}}
>

  <<diff>> days between

</$let>

@jeremyruston, how about we introduce a token “X” to DateFormat that is substituted with the Unix Timestamp (in seconds). Another token “x” could be used for Unix Timestamp in milliseconds.

This mimics how Moment.js formats dates.

Some systems use “%s” for Unix timestamp (as in seconds since Jan 1, 1970, I guess), so “s” or “S” is another choice, but of course could be mistaken for the “ss” token.

The substituted value is what Date.getTime() returns (divided by 1000 for seconds).