Parsing DateTime C# not working for my format -


i want parse date datetime "26 july 2015 - 17:57:37". problem have tried different formats on still not working.

string[] formats = { "dd mmm yyy - hh:mm:ss"};  if (datetime.tryparseexact(dateoflecture, formats, cultureinfo.invariantculture,                            datetimestyles.none, out tempdatetime)) {      lecture.dateandtime = tempdatetime; }                   

i searched on internet , applied relevent formats never worked.

you have 3 problems - months, years , hours.

string[] formats = { "dd mmmm yyyy - hh:mm:ss"}; 

Comments

Popular posts from this blog

python - jinja2: TemplateSyntaxError: expected token ',', got 'string' -

node.js - NodeJS remote terminal to Dropbear OpenWRT-Server -

Qt4: how to send QString inside a struct via QSharedMemory -