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

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -