That helped get the first email correct. I still have a timespan error as the second and third email times are off. They should be much closer to the first. New code below:
import base64, struct, datetime
def parse_thread_index(index):
s = base64.b64decode(index)
print("string decoded: ",s)
guid = struct.unpack('>IHHQ', s[6:22])
print("guid: ", guid)
guid = '{%08X-%04X-%04X-%04X-%12X}' % (guid[0], guid[1], guid[2], (guid[3] >> 48) & 0xFFFF, guid[3] & 0xFFFFFFFFFFFF)
f = struct.unpack('>Q', s[1:7] + b'\0\0')[0]
print("f: ", f)
print("f//10: ", f//10)
ts = [datetime.datetime(1601, 1, 1) + datetime.timedelta(microseconds=f//10)]
for n in range(23, len(s), 5):
f = struct.unpack('>I', s[n:n+4])[0]
print(" F:" , f)
ts.append(ts[-1] + datetime.timedelta(microseconds=(f<<18) //10))
return guid, ts
returns:
string decoded: b’\x01\x01\xd8\xef\xad,.zms\xa5j\xe8K\x93\xd4\xeaU\xdd\xba\x91s\xae.\xb1\xc3p\x80\x06\xb3\xe0`’
guid: (779775347, 42346, 59467, 10652396673151177075)
f: 133119716057022464
f//10: 13311971605702246
F: 783401840
F: 112451680
timestamps: [datetime.datetime(2022, 11, 3, 17, 53, 25, 702246), datetime.datetime(2023, 6, 29, 10, 26, 54, 896742), datetime.datetime(2023, 8, 2, 13, 17, 48, 216934)]
guid: {2E7A6D73-A56A-E84B-93D4-EA55DDBA9173}