read time in HH:mm format from excel

3 次查看(过去 30 天)
I have to read a column from excel file named Time ,the data in that column is in HH:mm format i need to read it and save it and display it in same format

回答(1 个)

Walter Roberson
Walter Roberson 2023-8-18
filename = 'AppropriateFileName.xlsx';
opts = detectImportOptions(filename);
opts = setvaropts(opts, {'Time'}, 'Type', 'duration', 'InputFormat', 'hh:mm', 'DurationFormat', 'hh:mm');
T = readtable(filename, opts);

标签

Community Treasure Hunt

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

Start Hunting!

Translated by