Duration precision in subtracting two datetimes

7 ビュー (過去 30 日間)
Andrea Sbaragli
Andrea Sbaragli 2021 年 5 月 24 日
編集済み: Adam Danz 2021 年 5 月 24 日
In subtracting two datetimes I lost what comes after the seconds. In particular
A(1,1) = '05-Mar-2021 13:01:53.917194495'
B(1,1) = '05-Mar-2021 11:41:36.619605504'
why C= A{1,1} - B{1,1} = 01:20:17??

採用された回答

Adam Danz
Adam Danz 2021 年 5 月 24 日
編集済み: Adam Danz 2021 年 5 月 24 日
Set the display format to include up to 9 fractional second digits
A = datetime('05-Mar-2021 13:01:53.917194495');
B = datetime('05-Mar-2021 11:41:36.619605504');
C = A-B;
C.Format = 'hh:mm:ss.SSSSSS'
C = duration
01:20:17.297588

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by