Skip to content

Bars Specification 0.1.0 — Transform: parse_date_time

Category: datetime · Since: 0.1.0

Parses a date-time string.

Parses a string input into kBars's date-time value kind using format ("iso8601"/"rfc3339" by default, "rfc1123"/"rfc2822", or any kotlinx.datetime Unicode format pattern). treatAsLocal ("true"/"false", default "false") interprets a timezone-naive string as local time instead of UTC. An unparseable string, or an invalid format pattern, is a soft failure (UnparseableInput) yielding null.

Input coercion: string

Arguments

Name Type Optional Default
format string yes "iso8601"
treatAsLocal boolean yes "false"

Arity: 0–2

Worked examples

{{ dt | parse_date_time }}

1970-01-01T00:00:02Z
{{ dt | parse_date_time: 'rfc3339' }}

1970-01-01T00:00:00Z

Full fixture: transforms/transform-parse_date_time.json