Exception while try Date.ParseExact in VB.NET -


i'm trying parse this:

date.parseexact("5/19/2012", "m/d/yyyy", mycultureinfo) 

in machine system date format mm/dd/yyyy, works fine. in machine system date format dd-mmm-yyyy or date format other mm/dd/yyyy, throws exception string not recognized valid datetime.. how can code above works regardless system date format?

i found solution

date.parseexact("5/19/2012", "m/d/yyyy", new globolization.cultureinfo("en-gb")).tostring(mycultureinfo) 

Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -