How to convert user input in dMy format to Mdy

Platform: ASP.NET| Category: Basic

VB.NET


Dim dt As DateTime = DateTime.ParseExact('0299', New String() {'My', 'M/y'}, Nothing, System.Globalization.DateTimeStyles.None)

C#


DateTime dt = DateTime.ParseExact('0299', new string[] {'My','M/y'}, null,System.Globalization.DateTimeStyles.None); 

For more details refer DateTime.ParseExact

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.