%% Find Hour Number of Datetime Values

t = datetime('today'):hours(8):datetime('tomorrow');
t.Format = 'MMM dd, HH:mm'

%

h = hour(t)

% Copyright 2015 The MathWorks, Inc.