This page is part of a static HTML representation of the TiddlyWiki at https://tiddlywiki.com/

format Operator (Examples)

 26th February 2023 at 1:56pm

These examples use the tiddler HelloThere.

Created date with no format string specified:

[[HelloThere]get[created]format:date[]]

Created date with a format string supplied as operator parameter:

[[HelloThere]get[created]format:date[DDth MMM YYYY]]

Modified date shown as a relative date:

[[HelloThere]get[modified]format:relativedate[]]

Get the date and time exactly 24 hours (86,400,000 milliseconds) from now:

[<now [UTC]YYYY0MM0DD0hh0mm0ss0XXX>format:date[TIMESTAMP]add[86400000]format:timestamp[DDth mmm YYYY 0hh:0mm:0ss]]

A tiddler title with spaces formatted as a title list:

[[Hello There]format:titlelist[]]

All tiddler titles tagged with formatted as a title list:

[tag[TableOfContents]format:titlelist[]]

A JSON string formatted as JSON – note how the JSON string is normalised to remove the duplicated properties:

[[{"one":"first","one":"another","two":"second"}]format:json[]]

Tip
To create a string to save a title list into a list field, use format:titlelist[] with the join operator

[tag[TableOfContents]format:titlelist[]join[ ]]

For example, to save titles tagged TableOfContents to the titles field of the tiddler format titlelist test:

<$button>Try it
<$action-setfield $tiddler="format titlelist test" titles={{{ [tag[TableOfContents]format:titlelist[]join[ ]] }}}/>
</$button>

That renders as: