c# - Why can't I parse this string to date? -


i trying parse string datetime:

string datum = "13/7/2013"; datetime dtdatum = datetime.parseexact(datum, "yyyy-d-m", cultureinfo.getcultureinfo("nl-nl")); 

i'm getting "formatexception unhandled user code". i've tried several formats, , different cultureinfo's, nothing seems work. i've searched on google , website, can't seem find answer gets rid of exception.

help appreciated.

your input format not same "format specifier defines required format of" input.

the datetime.parseexact(string, string, iformatprovider) method parses string representation of date, must in format defined format parameter.

so input need string datum = "2013/13/7";; match format specifier.


Comments

Popular posts from this blog

Issues changing the value of an element in an array in matlab -

php - MySQLi binding parameters in a prepared statement doesn't work unless inserted after "WHERE" -

vb.net - Alternative to the T-SQL AS keyword -