格式异常由用户代码处理...字符串未被识别为有效的日期时间.. [英] format exception was handled by user code...string was not recognised as a valid Date Time..

查看:119
本文介绍了格式异常由用户代码处理...字符串未被识别为有效的日期时间..的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

格式异常由用户代码处理...字符串未被识别为有效日期时间..现在出现此错误..





string [] a = new string [] {dd / MM / yyyy,MM / dd / yyyy,MM / dd / yy,ddMMMyyyy,dMMMyyyy,dd-MM -yyyy,MM-dd-yy,MMM dd};

result = DateTime.ParseExact(dateString,a,System.Globalization.CultureInfo.CurrentCulture,System.Globalization.DateTimeStyles。没有);





任何人都可以帮助我..

format exception was handled by user code...string was not recognised as a valid Date Time..i m getting this error..


string[] a = new string[] { "dd/MM/yyyy", "MM/dd/yyyy", "MM/dd/yy", "ddMMMyyyy", "dMMMyyyy","dd-MM-yyyy","MM-dd-yy","MMM dd" };
result = DateTime.ParseExact(dateString, a, System.Globalization.CultureInfo.CurrentCulture, System.Globalization.DateTimeStyles.None);


can anyone help me pls..

推荐答案

错误是用简单的英语写的。你觉得这意味着什么? dateString不是有效的日期时间。
The error is written in plain english. What do you think it means ? dateString is not a valid date time.


这篇关于格式异常由用户代码处理...字符串未被识别为有效的日期时间..的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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