Mapping Toolbox | ![]() ![]() |
Convert times between different units
Syntax
Description
timeout = timedim(timein,from
,to
) returns the value of the input time timein
, which is in units specified by the valid time units string from
, in the desired units given by the valid time units string to
. Valid time units strings are:
'hours' or 'hr' for decimal hours 'seconds' or 'sec' for seconds 'hms' for hours-minutes-seconds 'hm' for hours-minutes
Examples
Convert from hours to seconds:
What is the difference between hms and hm? (best displayed in bank format)
The hm answer is the hms answer correctly rounded to whole minutes
(i.e., rounded based on 60 seconds per minute, not 100).
See Also
angledim |
Convert angle units |
distdim |
Convert distance units |
hr2hms hr2sec |
Other direct time conversion functions |
time2str |
Convert time to selected display string |
![]() | time2str | timezone | ![]() |