I have a datetime '06-Sep-2012 09:29:00' or datenum "7.3387e+05", how do I write to a text file as follow "20120906 092900"

1 次查看(过去 30 天)
I have a datetime '06-Sep-2012 09:29:00' or datenum "7.3387e+05", how do I write to a text file as follow "20120906 092900"

回答(1 个)

Fangjun Jiang
Fangjun Jiang 2018-4-6
a=datetime('06-Sep-2012 09:29:00');
b=datestr(a,'YYYYMMDD HHmmss')

类别

Help CenterFile Exchange 中查找有关 Dates and Time 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by