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
Max
November 16, 2022, 5:38pm
2
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
Max
November 18, 2022, 7:29pm
3
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.
addDateTime adds or subtracts a unit of time from a datetime value. For example, addDateTime(2,'YYYY',parseDate('02-JUL-2018', 'dd-MMM-yyyy') ) returns 02-JUL-2020 . You can use this function to perform date math on your date and time data.