How Do I Have my Program Accept a Negative Year as Valid

2 次查看(过去 30 天)
I am creating a time calculator game to learn how to code and am running into trouble when I input a negative year. How can I program a time calculator that recognizes this negative year as BCE while not displaying an invalid message? I

回答(1 个)

Alexander
Alexander 2024-2-16
datetime(-1,1,1) answeres 01-Jan--0001 which is correct.
  2 个评论
CHRISTY
CHRISTY 2024-2-16
Thank you, how would I do this for the MM/DD/YYYY format where the user enteres their date like this?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Just for fun 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by