开发者

Converting Indonesian (id-ID) Date To English (en-US) Date

开发者 https://www.devze.com 2023-03-25 17:40 出处:网络
I am facing problem while converting Indonesian Date to English Date. Ex : I got an Date which is in Indonesian Language i.e 24/mars/1958

I am facing problem while converting Indonesian Date to English Date. Ex : I got an Date which is in Indonesian Language i.e 24/mars/1958 so I have to convert this date to English Date i.e 24/mar/1958 I tried to convert the date by using following code

string date = "24/mars/1958";
string newDate = DateTime.Parse(date, new CultureInfo("id-ID")).ToShortDateString();

but th开发者_运维技巧e above code is throwing error so can any one let me know how to convert this date to English Date

Thanks in Advance Nitesh Katare


Use DateTime.TryParseExact Method.

0

精彩评论

暂无评论...
验证码 换一张
取 消