c# - DateTime Parsing "Wed Mar 12 2014 17:50:15 GMT+0000 -


i got format exception when trying parse

// input string "wed mar 12 2014 17:50:15 gmt+0000 (utc)" datetime.parse(response.lastactivitydate);  

a first chance exception of type system.formatexception

how can parse input string ? culture ?

thank in advance!

here, have fish:

string value = "wed mar 12 2014 17:50:15 gmt+0000 (utc)"; value = value.replace("gmt","").replace("(utc)","").trim(); value = value.insert(value.length - 2, ":"); datetime parsed = datetime.parseexact(value, "ddd mmm dd yyyy hh:mm:ss zzz",                                        cultureinfo.invariantculture); 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -