检测无效日期 [英] Detecting an Invalid Date

查看:86
本文介绍了检测无效日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果日期字段包含无效日期,则需要对其进行标记。但是,我的代码没有承认它。例如,它并不认为8/15/0007是一个糟糕的日期。任何帮助将不胜感激。


When a date field contains an invalid date, it needs to be flagged. However, my code is not acknowledging it. For instance, it doesn''t recognize 8/15/0007 as a bad date. Any assistance would be appreciated.


展开 | 选择 | Wrap | 行号

推荐答案

为什么不是'这是一个有效的约会吗?有0007年这样的事情。
Why isn''t it a valid date? There is such a thing as year 0007.


如果你想使用术语''无效日期',大多数人都不会理解它,那么你应该在你的问题中清楚地定义你的意思。这样我们就可以智能地响应它。
If you want to use the term ''invalid date'' differently from how most people would understand it then you should define what you mean clearly in your question. That way we can respond intelligently to it.


我认为你应该为你的问题陷入你的状况 startYear和EndYear之间的年份(字段)

ex:
I think you should trap your condition Year(field) between startYear and EndYear for your problem
ex:
展开 | 选择 | Wrap | 行号


这篇关于检测无效日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆