Why doesn't datetime error out when an impossible result is calculated in R2024b?
For example, I'm running:
>> datetime ("03-Feb-2025","Format","DD-MMM-uuuu HH:mm:ss.sss")Warning: The format 'DD-MMM-uuuu HH:mm:ss.sss' contains fields for month (M) and for day of year (D). This will cause unexpected results when converting from text.See the datetime.Format property for a complete description of the identifiers used in datetime formats.> In verifyFormat (line 34)In datetime (line 188) ans = datetime 34-Feb-2025 00:00:00.000 >>
Matlab only issues a WARNING (not an ERROR) and produces an impossible result, i.e. 34-Feb-2025.
Is this expected?
(Setting « dd » instead of « DD” gives the correct result.)
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Dates and Time에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!