FriendlyID Changes the Hex Number to a human friendly datetime and dateStr IDf ID as DateTime Object, PrjID returns the ProjectID, Str returns the timestamp as String
0001 function [IDf,PrjID, Str] = FriendlyID(ID) 0002 %FriendlyID Changes the Hex Number to a human friendly datetime and dateStr 0003 % IDf ID as DateTime Object, PrjID returns the ProjectID, Str returns the 0004 % timestamp as String 0005 0006 %Remove Prefix 0007 if contains(ID,'-') 0008 IDarray = split(ID, '-'); 0009 PrjID = IDarray{1}; 0010 ID = IDarray(2); %keep only the second part 0011 else 0012 PrjID = ''; 0013 end 0014 0015 ID = hex2dec(ID); % get it back as dec 0016 IDf = datetime(ID,'ConvertFrom','posixtime'); 0017 Str = datestr(IDf); 0018 0019 end 0020