date_format fields and methods A field is a plain fact about the value, read with a dot and no brackets: $value.name. A method takes arguments or does work, and is called with ->: $value->name(arguments), or with the value piped in: $value |> name(arguments).
Fields Field Type Description .examplestring A date written this way, to show what it looks like: 07-03-2026 for dd-MM-yyyy (Saturday 7 March 2026, 14:05:09). .has_datebool True when it shows a day, month, year or era. .has_timebool True when it shows an hour, minute, second or AM/PM. .tokenslist Its parts in order: ['dd', '-', 'MM', '-', 'yyyy'].
From KScript.Core # date_format ->format (date: date ) → string The date written this way: 07-03-2026.
Parameter Takes date required date
Example
.kscript XML Copy
<let name="x" type="date_format" value="'dd MMM yyyy, HH:mm'" />
<echo>{ $x->format('2026-11-22T16:30:00'->to_date()) }</echo>.kscript XML Copy
$x: date_format = 'dd MMM yyyy, HH:mm'
echo $x->format('2026-11-22T16:30:00'->to_date())# date_format ->parse (text: string ) → date Reads text written this way as a date: dd-MM-yyyy reads '07-03-2026'.
Parameter Takes text required string
Example
.kscript XML Copy
<let name="x" type="date_format" value="'dd MMM yyyy, HH:mm'" />
<echo>{ $x->parse('22 Nov 2026, 16:30')->format('yyyy-MM-dd') }</echo>.kscript XML Copy
$x: date_format = 'dd MMM yyyy, HH:mm'
echo $x->parse('22 Nov 2026, 16:30')->format('yyyy-MM-dd')Methods from any Methods from string