subtracting time - datetime

24 views (last 30 days)
Luis Eduardo Cofré Lizama
Hi All, I'm struggling to substract the initial time from a datetime variable and get the results including milliseconds. I'n doing as below but I get "Error using datetime (line 668), Input data must be a numeric array, a string array, a cell array containing character vectors, or a char matrix.
t1 = datetime(t-t(1),'Format','hh:mm:ss.SSS');
Can you help me to figure out what's wrong?
Cheers
  2 Comments
Luis Eduardo Cofré Lizama
That was quick and effective!, t was already a datetime. Thansk works!

Sign in to comment.

Answers (0)

Categories

Find more on Data Type Conversion in Help Center and File Exchange

Tags

Products


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by