Skip to main content

DateStringToISOFormat

This Script is part of the Filters And Transformers Pack.#

This is a thin wrapper around the dateutil.parser.parse function. It will parse a string containing a date/time stamp and return it in ISO 8601 format.

Script Data#


NameDescription
Script Typepython3
Tagstransformer, date
Cortex XSOAR Version5.0.0

Inputs#


Argument NameDescription
valueDate value to convert.
dayfirstWhether to interpret the first value in an ambiguous 3-integer date (e.g. 01/05/09) as the day (``True``) or month (``False``). If ``yearfirst`` is set to ``True``, this distinguishes between YDM and YMD.
yearfirstWhether to interpret the first value in an ambiguous 3-integer date (e.g. 01/05/09) as the year. If ``True``, the first number is taken to be the year, otherwise the last number is taken to be the year.
fuzzyWhether to allow fuzzy parsing, allowing for string like "Today is January 1, 2047 at 8:21:00AM".
add_utc_timezoneWhether to add UTC timezone to the date string returned in case offset-naive date was provided as input.

Outputs#


There are no outputs for this script.

Script Examples#

Example command#

!DateStringToISOFormat value="'05-11-2929'" dayfirst="true" yearfirst="true" fuzzy="true" add_utc_timezone="false"

Context Example#

{}

Human Readable Output#

2929-11-05T00:00:00