Qustion about :datestr a bug? or something others

Why
datestr('2011-01-02 00:00:01','yyyy-mm-dd HH:MM:SS AM')
result in 2011-01-02 12:00:01 AM otherwise 2011-01-02 00:00:01 AM???
On the other hand, datestr('2011-01-02 12:00:01','yyyy-mm-dd HH:MM:SS AM') result in 2011-01-02 12:00:01 PM other than 2011-01-02 00:00:01 PM?* Is there a bug? or I had made a mistake?

 採用された回答

Jan
Jan 2011 年 8 月 2 日

2 投票

The time 12:00 is called "12 PM", not "0 PM". This is a convention - but a confusing one and not everybody follows it. See: WikiPedia: 12 hour clock.

1 件のコメント

Du Xiao
Du Xiao 2011 年 8 月 3 日
Thank you very much for your help. Thank you a lot.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

タグ

質問済み:

2011 年 8 月 2 日

Community Treasure Hunt

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

Start Hunting!

Translated by