Hi @DonovanC ,
In addition to what Joshua mentioned, it seems you have different date notations MM/DD/YYYY and DD-MM-YYYY and there is more than a single date in the text field.
To provide an example to extract the first data based on what I have seen from the screenshot, here is an example with Arcade (in Python this could be done in a lot less lines):
Function Convert2DateTime(txt) {
var dttxt = Mid(txt, 1, 22);
var y = Number(Mid(dttxt, 6, 4));
var mi = Number(Mid(dttxt, 14, 2));
var s = Number(Mid(dttxt, 17, 2));
if (Find("-", dttxt) == -1) {
// MM/DD/YYYY HH:mm:SS AP
// 0123456789012345678901
// 05/09/2020 10:46:41 AM
var mo = Number(Mid(dttxt, 0, 2)) -1;
var d = Number(Mid(dttxt, 3, 2));
var ampm = Right(dttxt, 2);
if (ampm == "AM") {
var h = Number(Mid(dttxt, 11, 2));
} else {
var h = Number(Mid(dttxt, 11, 2)) + 12;
}
} else {
// DD-MM-YYYY HH:mm:SS
// 0123456789012345678
// 09-05-2020 10:46:41
var mo = Number(Mid(dttxt, 3, 2)) -1;
var d = Number(Mid(dttxt, 0, 2));
var h = Number(Mid(dttxt, 11, 2));
}
// Date(year, month, day, hours, minutes, seconds)
return Date(y, mo, d, h, mi, s);
}
var dts = ['<09-05-2020 10:46:41> 0-1 <09-05-2020 10:46:46>',
'<09/05/2020 10:55:17 AM> 1'];
for (var i in dts) {
var txt = dts[i];
Console("txt: " + txt);
var dt = Convert2DateTime(txt);
Console("dt: " + dt);
}
return "OK";
In this example, two different formats as send to the function to validate the result. It will print the following to the console:
txt: <09-05-2020 10:46:41> 0-1 <09-05-2020 10:46:46>
dt: 2020-05-09T10:46:41-05:00
txt: <09/05/2020 10:55:17 AM> 1
dt: 2020-09-05T10:55:17-05:00