As Steven Lord wrote, serial date numbers are not the right tool for the task: amongst other things you will struggle against defining an appropriate pivot year (which is essential for the task that you are attempting) and as you have already found DATESTR will (by design) return the hours of a day, not an arbitrarily increasing hour count.
But you can easily do it yourself without serial date numbers, here using time in seconds:
a = v * sscanf('21:10:00','%d:%d:%d');
b = v * sscanf( '1:10:00','%d:%d:%d');
x = v * sscanf('21:10:00','%d:%d:%d');
y = v * sscanf( '7:10:00','%d:%d:%d');
where:
function str = mytime(tmp)
str = sprintf('%02d:%02d:%02d',spl);
Best Answer