ASP.NET中的ParseExact日期时间
当我的调试器到达这一点时,它给了
不有效的日期时间
代码:
DateTime oDate1 = DateTime.ParseExact(
expDate,
"M/dd/yyyy h:mm:ss tt",
System.Globalization.CultureInfo.InvariantCulture);
extdate
日期包含日期
"13-May-22 13:24:00".
我尝试搜索搜索,但没有得到满足的帮助
When my debugger reaching this point it is giving as
not valid date time
Code:
DateTime oDate1 = DateTime.ParseExact(
expDate,
"M/dd/yyyy h:mm:ss tt",
System.Globalization.CultureInfo.InvariantCulture);
expDate
date contains date
"13-May-22 13:24:00".
I tried googling it but didn't got it satisfied help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在提供的示例中有一个歧义:
如果月
May
是缩写的(例如apr
,jun )或不(喜欢
April
,6月
)。为了拥抱两种可能性,我们应该尝试两种格式:代码:
如果您知道如何解决歧义,则可以简化代码,例如,如果月份是缩写
There's an ambiguity in the example provided:
If month
May
is abbreviated (likeApr
,Jun
) or not (likeApril
,June
). To embrace both possibilities we should try two formats:Code:
If you know how to solve the ambiguity, you can simplify the code, e.g. if month is abbreviated