Datetime
Last updated
Last updated
Datetime Parses input string and converts into an epoch milliseconds format number. Input must be a string. @param tzmap: type dict (optional). Dictionary of timezone mappings from custom/local to standard timezones. @param expr: type string (optional). A custom timestamp format with UTC/local timezone. This function can be used when the datasets needs date time conversion to milliseconds or other local timezone format.
Step 1: Create an empty datetime_example_1 using AIOps studio as shown in the below screenshot.
Step 2: Add the following pipeline code/commands into the above-created pipeline as shown in the below screenshot:
You can copy the below code into your pipeline and execute that in your environment.
##### This pipeline creates a dataset row using current year.
##### dm function datetime is used to convert year data into milliseconds
@dm:empty
--> @dm:addrow Year_To_Epoch_MS = '2021'
--> @dm:addrow Year_To_Epoch_MS = '2031'
--> @dm:map attr = 'Year_To_Epoch_MS' & func = 'datetime'
Step 3: Click verify button to make sure syntax and pipeline code is correct (as shown below)
Step 4: Click execute button and execute the pipeline. RDA will execute the pipeline without any errors (as shown below)
Step 5: RDA uses the dm function datetime to convert year in string format to milliseconds format. This function will be useful when the dataset contains year(s) as column values and needed to convert to milliseconds for further time calculations.