How to split multiple numbers which is one number from data file?

202021031200
this is has year date and time, how do I split the numbers into year date and time?

回答(1 个)

D = 202021031200;
T = datetime(string(D), 'InputFormat', 'uuuuddMMHHmm')
T = datetime
21-Mar-2020 12:00:00

类别

帮助中心File Exchange 中查找有关 Dates and Time 的更多信息

产品

版本

R2022b

提问:

2022-10-15

Community Treasure Hunt

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

Start Hunting!

Translated by