Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

time

Convert time of calendar duration to duration

Syntax

t = time(d)

Description

example

t = time(d) returns the time components of the calendar duration values in d as durations. The t output is the same size as d.

Examples

collapse all

Create an array of calendar durations.

d = caldays(8:10) + hours(1.2345)
d = 1x3 calendarDuration array
    8d 1h 14m 4.2s    9d 1h 14m 4.2s   10d 1h 14m 4.2s

Convert the time components of the array to durations.

t = time(d)
t = 1x3 duration array
   01:14:04   01:14:04   01:14:04

View the data type of t.

whos t
  Name      Size            Bytes  Class       Attributes

  t         1x3                40  duration              

Input Arguments

collapse all

Input calendar duration, specified as a scalar, vector, matrix, or multidimensional calendarDuration array.

Extended Capabilities

Introduced in R2014b

Was this topic helpful?