MATLAB: Need to find time difference between two time strings

datetime datestr time difference

Hi I have two (as a sample) matlab serial date numbers which I want to find the gap between them. hours minutes and seconds. these are the time I have: d1 = 7.314983860995370e+005 d2 = 7.314983864467592e+005
any help is greatly appreciated

Best Answer

datetime(d2, 'ConvertFrom', 'datenum') - datetime(d1, 'ConvertFrom', 'datenum')