I suggest adding a new filter operator suffix: format:timestamp[dateformat]
, which takes an integer value as input, and outputs a date string using TWCore Date format codes.
I do this as part of https://tiddlytools.com/#TiddlyTools%2FTime%2FParseDate using the keyword “unixtime” (equivalent to the new TWCore “TIMESTAMP” keyword)
For example, the following takes the current tiddler’s modified
field value (a UTC 17-digit TWCore serial date), and converts it to a unix epoch timestamp integer using {!!modified}parsedate[unixtime]
. Then it takes that result and converts it back to a UTC 17-digit TWCore serial date using <epochtime>parsedate:unixtime[]
<$let epochtime={{{ [{!!modified}parsedate[unixtime]] }}}>
<$let coretime={{{ [<epochtime>parsedate:unixtime[]] }}}>
MODIFIED=<$text text={{!!modified}}/><br>
EPOCHTIME=<<epochtime>><br>
CORETIME=<<coretime>>
Note that the default filter parameter for <epochtime>parsedate:unixtime[]
is [UTC]YYYY0MM0DD0hh0mm0ss0XXX
(i.e., a standard UTC 17-digit TWCore serial date), but you could also specify any valid TWCore Date format codes you want, e.g.:
<$let coretime={{{ [<epochtime>parsedate:unixtime[DDD, MMM DDth YYYY at 0hh12:0mm:0ss]] }}}>
If handling for format:timestamp
is added to the TWCore, the syntax equivalent to my custom parsedate
filter operator would be something like this:
<$let epochtime={{{ [{!!modified}format:date[TIMESTAMP]] }}}>
<$let coretime={{{ [<epochtime>format:timestamp[DDD, MMM DDth YYYY at 0hh12:0mm:0ss]] }}}>
-e