Skip to content

AsDate

mapping category: type-conversion no `||`

Transforms any type of input into a date.

Integers are interpreted as seconds, floats are rounded and interpreted as seconds, and strings are parsed into a date using a best-effort algorithm. The string parser is not learning, which means it does not always get the dates right. To be explicit about the format, supply a strftime-style format template as the first parameter.

Parameters

1format Optional — accepts: STRING

A strftime-style format template applied when the input is a string. Optional and only meaningful for string input.

Input type

  • DATE
  • FLOAT
  • INT
  • STRING

Output type

  • DATE

Examples

Default best-effort string parser

AsDate()

Explicit format template

AsDate("%d%m%y-%H%M%s")

See also

AsFloat, AsInt, AsString

References