Hi all,
I am confident with strptime/strftime but i'm really struggling with the correct strptime argument for the following date/time format -
2023-01-25T21:32:04:501+0000
The T between date and time is causing me issues. Thank you in advance!
Are you getting an error? Adding a "T" in the format is allowed, the following works for me:
| makeresults
| eval example="2023-01-25T21:32:04:501+0000"
| eval parsed_dt=strptime(example, "%Y-%m-%dT%H:%M:%S:%Q%z")
| eval parsed_s=strftime(parsed_dt, "%Y-%m-%dT%H:%M:%S:%Q%z")
Are you getting an error? Adding a "T" in the format is allowed, the following works for me:
| makeresults
| eval example="2023-01-25T21:32:04:501+0000"
| eval parsed_dt=strptime(example, "%Y-%m-%dT%H:%M:%S:%Q%z")
| eval parsed_s=strftime(parsed_dt, "%Y-%m-%dT%H:%M:%S:%Q%z")
Perfect thank you! It was the %Q i was missing. Much appreciated.