FUNCTION REFERENCE

hms

Hour, minute and second numbers of a datetime or duration array.

Hour, minute and second numbers of a datetime or duration array.

Syntax

[h, m, s] = hms(t)

The seconds keep their fraction. For a duration the hours are not limited

to 24 and every part has the duration's sign.

Example

[h, m, s] = hms(datetime(2024, 1, 1, 13, 5, 7.5))   % 13, 5, 7.5

Example

[h, m, s] = hms(hours(25.5))   % 25, 30, 0

Differences from MATLAB: None known.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.