Is 1900 a leap year?
3 次查看(过去 30 天)
显示 更早的评论
Is 1900 a leap year?
I keep on getting error saying 1900 is not a leap year.
0 个评论
采纳的回答
Abhishek Jain
2016-10-6
No, 1900 is not a leap year. Condition for an year to be Leap year us that it should be divisible by 4. But if it is century like 1900, it should be divisible by 400.
Hope that helps !!
1 个评论
Walter Roberson
2016-10-6
By the way, the Excel numeric date format was created on the assumption that 1900 was a leap year, so if you are going back and forth with Excel, you may encounter an issue that the dates in Excel seem off by 1 day. There are a few different ways to handle that automatically:
https://www.mathworks.com/help/matlab/ref/datetime.html#inputarg_dateType datetime() with 'convertfrom', 'excel'
https://www.mathworks.com/help/matlab/ref/readtable.html#input_argument_namevalue_DatetimeType readtable() with 'DatetimeType', 'exceldatenum'
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Dates and Time 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!