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

format Operator

 21st March 2023 at 1:22pm
purposeformat the input string according to one of supported formats
inputa selection of titles
suffixB=one of supported formats
parameterC=optional format string for the formats
outputinput strings formatted according to the specified suffix B

Learn more about how to use Filters

Introduced in v5.1.23

The suffix B is one of the following supported string formats:

FormatDescription
dateThe input string is interpreted as a UTC date and displayed according to the DateFormat specified in the optional parameter C. (Defaults to "YYYY MM DD 0hh:0mm")
jsonIntroduced in v5.2.4 The input string is interpreted as JSON and displayed with standard formatting. The optional parameter C specifies the number of spaces to use for indenting, or a string to use for indenting. Nothing is returned if the input string is not valid JSON
relativedateThe input string is interpreted as a UTC date and displayed as the interval from the present instant. Any operator parameters C are ignored
timestampNew in v5.3.0 The input string is interpreted as number of milliseconds since the ECMAScript epoch, 1 January 1970, and displayed according to the DateFormat specified in the optional operator parameter. (Defaults to "[UTC]YYYY0MM0DD0hh0mm0ss0XXX")
titlelistIntroduced in v5.2.0 The input string wrapped in double square brackets if it contains a space. Appropriate for use in a title list.

Invalid input strings are dropped by the format operator.

Warning
The Title List format cannot reliably represent items that contain certain specific character sequences such as ]] . Thus it should not be used where there is a possibility of such sequences occurring.

Examples