Parse date down to microsecond using parseDate

Hi, I have many string contain a datetime which precision up to microsecond. i.e.

“2022-11-09T10:05:18.260371+00:00”
“2022-11-11T08:42:41.900687+00:00”
“2022-11-10T07:40:38.157132+00:00”
“2022-11-10T11:26:53.090493+00:00”
“2022-11-14T04:52:30.891354+00:00”

I tried to use parse date with many pattern, but none of them seem to deal with the “microseconds” part. Please help me, thanks so much

I would cut off the microseconds and then parse the date.

cut_off = substring({date},1,strlen(‘2022-11-09T10:05:18.260371’))

parsed_date = parseDate(cut_off,“yyyy-MM-dd’T’HH:mm:ss”)

1 Like

If you need to add microseconds I would then do the same process to get the substring but instead of the front of the string return the end of the string.

then you can addDatetime of miliseconds onto it.