DateTime equal but report not equal

Time1=datetime('04:00:00','InputFormat',"HH:mm:ss");
Time2=datetime(0,0,0,4,0,0);
Time1~=Time2
ans =
logical
1

 採用された回答

Star Strider
Star Strider 2020 年 7 月 25 日

1 投票

They are not the same:
Time1=datetime('04:00:00','InputFormat',"HH:mm:ss")
Time2=datetime(0,0,0,4,0,0)
produces:
Time1 =
datetime
25-Jul-2020 04:00:00
and:
Time2 =
datetime
30-Nov--0001 04:00:00
.

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeDates and Time についてさらに検索

質問済み:

2020 年 7 月 25 日

回答済み:

2020 年 7 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by