MATLAB: When export date/time to excel, change the time(mm:ss)..

automaticallychangedatedatetimetimewritetable

Hi all.
I have a problem.
Now, time is 2017-02-05 21:35:32.
But I want to export 2017-02-05 21:00:00 except minute, scecond.
But when I use writetable(to .xlsx), time changed 2017-02-05 21:35:32 in excel.
t = datetime('now','TimeZone','Asia/Seoul','Format','yyyy-MM-dd HH:00:00') % 2017-02-05 21:00:00

T = table(t); % 2017-02-05 21:00:00
writetable(T,filename); % 2017-02-05 21:35:32
What is problem in this code?

Best Answer

Use dateshift to round the datetimes down to the start of the hour before saving to the file.