issues writing a time string to excel

1 回表示 (過去 30 日間)
A
A 2016 年 1 月 12 日
回答済み: Adithya Addanki 2016 年 1 月 14 日
I am trying to write the following string (generated using datestr) into excel: '12:01:33.500 AM'
In excel, it truncates the hour (somehow it gets auto-formatted to mm:ss. If I manually change the format to general, it shows some meaningless number 0.00108217592592593). I only have this issue with '12' as the hour- for example, '1:00:37.750 AM' exports fine (cell is formatted as general).
any idea what's going on?

回答 (1 件)

Adithya Addanki
Adithya Addanki 2016 年 1 月 14 日
Hi,
I noticed the same on my machine, but it displayed the time in required format when I changed the format of the cell to "Time".
Please format the cell as "Time". You may also select "Custom" and pick a format that you would prefer to see.
Thank you,
Adithya

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by