从字符串(阿拉伯文化到英语)转换为dateTime [英] Convert to dateTime from string (arabic culture to english)

查看:61
本文介绍了从字符串(阿拉伯文化到英语)转换为dateTime的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

string strHijdt =29-02-1435;

DateTime hdt = DateTime.ParseExact(strHijdt,dd / MMM / yyyy HH:MI24,CultureInfo.InvariantCulture);



将字符串(29-02-1435)转换为datetime

string strHijdt ="29-02-1435";
DateTime hdt = DateTime.ParseExact(strHijdt, "dd/MMM/yyyy HH:MI24",CultureInfo.InvariantCulture);

Getting error while converting string("29-02-1435") to datetime

推荐答案

时出错。很明显数据和格式完全不匹配。此外,我不确定你能否支持1435年(如果是这一年)。也许,你的意思是伊斯兰日历,Hijri: http://en.wikipedia.org/wiki/Arabic_calendar [ ^ ]。



然后,你应该使用非常特殊的类,这个类: http://msdn.microsoft.com/en-us/library/system.globalization.hijricalendar%28v=vs.110%29.aspx [ ^ ]。



-SA
It's quite obvious that the data and format don't match at all. Besides, I am not sure you can support the year of 1435 (if this is the year). Probably, you mean Islamic Calendar, Hijri: http://en.wikipedia.org/wiki/Arabic_calendar[^].

Then, you should use the very special class, this one: http://msdn.microsoft.com/en-us/library/system.globalization.hijricalendar%28v=vs.110%29.aspx[^].

—SA


这篇关于从字符串(阿拉伯文化到英语)转换为dateTime的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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