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 view (last 30 days)
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"

Answers (1)

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

Categories

Find more on Dates and Time in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!