FormattedDateToEpoch

Converts a custom-formatted timestamp to UNIX epoch time. Use it to convert custom time stamps to a XSOAR date field. If you pass formatter argument, we will use it to transform. If not, we will use dateparser.parse for transforming. For more info, see: https://docs.python.org/3.7/library/datetime.html#strftime-and-strptime-behavior

python · Filters And Transformers

Details

IDFormattedDateToEpoch
Languagepython
From Version5.0.0
Docker Imagedemisto/python3:3.12.13.10404775
Tagstransformer date

README

Converts a custom-formatted timestamp to UNIX epoch time. Use it to convert custom time stamps to a XSOAR date field. If you pass formatter argument, we will use it to transform. If not, we will use dateparser.parse for transforming. For more info, see: https://docs.python.org/3.7/library/datetime.html#strftime-and-strptime-behavior

Script Data


Name Description
Script Type python3
Tags transformer, date
Cortex XSOAR Version 5.0.0

Inputs


Argument Name Description
value Time stamp to convert
formatter Python ‘strptime’ formatter string

Outputs


There are no outputs for this script.

commonfields:
  id: FormattedDateToEpoch
  version: -1
name: FormattedDateToEpoch
script: '-'
type: python
subtype: python3
tags:
- transformer
- date
comment: 'Converts a custom-formatted timestamp to UNIX epoch time. Use it to convert custom time stamps to a XSOAR date field. If you pass formatter argument, we will use it to transform. If not, we will use dateparser.parse for transforming. For more info, see: https://docs.python.org/3.7/library/datetime.html#strftime-and-strptime-behavior'
enabled: true
args:
- name: value
  required: true
  description: Time stamp to convert.
- name: formatter
  description: Python 'strptime' formatter string.
scripttarget: 0
isllm: false
dockerimage: demisto/python3:3.12.13.10404775
runas: DBotWeakRole
tests:
- FormattedDateToEpochTest
fromversion: 5.0.0