Mon May 22 2017 13:25:00 GMT+0530 (India Standard Time)
in this string want contents between "Mon" and "GMT" and convert that string into datetime format.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Dharmraj ThakurRank #577 · 4.2K reputationPosted May 22, 2017, 12:55 AM EDT
Mazhar Pasha62 reputationPosted May 22, 2017, 4:01 AM EDT
You're going to need to use
DateTime.ParseExact:var date = DateTime.ParseExact( "Mon Jan 13 2014 00:00:00 GMT+0000 (GMT Standard Time)", "ddd MMM dd yyyy HH:mm:ss 'GMT'K '(GMT Standard Time)'", CultureInfo.InvariantCulture);after parsing the date you can then send it out your way:
date.ToString("yyyy-MM-dd");