Skip to content

Date

This task parses a string representation of a date/time and allows transformation of it, such as specifying an offset or changing the format, and saves the result as a date/time string in an variable.

Step implementations

Arguments

  • variable str - name of, initialized, variable the parsed date should be saved in

  • value str - value

Format

value

<date> [| format=<format>][, timezone=<timezone>][, offset=<offset>]
  • date str | datetime - string representation of a date and/or time or a datetime object, e.g. datetime.now()

  • format str - a python strftime format string or ISO-8601:[DateTime|Time][:ms][:no-sep], this argument is required

  • timezone str (optional) - a valid timezone name

  • offset str (optional) - a time span string describing the offset, Y = years, M = months, D = days, h = hours, m = minutes, s = seconds, e.g. 1Y-2M10D

ISO-8601

See wikipedia ISO 8601 for information about the format. Specifying DateTime would result in "Date and time with the offset" and Time results in everything after "T" in the same example.

In addition to this it is also possible to append milliseconds with :ms and remove all the seperators in the date and time with :no-sep.