convert from ddmmyyyy to mmddyyyy in c#

    技术2022-07-06  177

    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....   Posted: Wed Aug 27, 2008 10:37 am    Post subject:
    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.. 


    最新回复(0)