convert from dd/mm/yyyy to mm/dd/yyyy in c#

Hi All, 

I need to convert dd/mm/yyyy string to valid Datetime using C#. Please help me. It is urgent. 

Thanking you in Advance. 
Bye....
 

PostPosted: Wed Aug 27, 2008 10:37 am    Post subject: Reply with quote

Hi Mouli, 

Try this Code: 

string UrDate = "27/08/2008"; 
System.Globalization.DateTimeFormatInfo dateInfo = new System.Globalization.DateTimeFormatInfo(); 
dateInfo.ShortDatePattern = "dd/MM/yyyy"; 
DateTime validDate= Convert.ToDateTime(toDate, dateInfo); 

validDate will contains the Valid Datetime.. 
阅读更多
文章标签: c# string
上一篇debug 显示locals 窗口
下一篇2011/1/17 进度缓慢原因
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭