how to correct NaT in datetime
古いコメントを表示
when i do as
st = datetime('13:00:00');
et = datetime('14:00:00');
t = datetime(cellTime);
tp = isbetween(t, st, et);
i have time between 13 and 14 in my cell array named cellTime, but when i process it as below,
t = datetime(cellTime, 'Format', 'hh:mm:ss');
i get all time after, 12pm as "NaT" i wanted to do as
t = datetime(cellTime, 'Format', 'hh:mm:ss');
because i need only the time value, if i dont use format, the date also comes, and that too todays date... any method to get only time and correct the NaT
1 件のコメント
Walter Roberson
2017 年 2 月 27 日
What is the format of the entries in cellTime ?
採用された回答
その他の回答 (1 件)
Walter Roberson
2017 年 2 月 27 日
t = datetime(cellTime, 'InputFormat', 'hh:mm:ss', 'Format', 'hh:mm:ss');
1 件のコメント
Elysi Cochin
2017 年 2 月 27 日
カテゴリ
ヘルプ センター および File Exchange で Dates and Time についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!