Quote:
"Wed May 03 2017 05:04:00 GMT+0530 (India Standard Time)"
from this string only want "May 03 2017 05:04:00"
this part.
No, you don't. You need almost entire text to be able to convert that string into date, at least:
Wed May 03 2017 05:04:00+0530
I answered your previous question here:
Convert string to date format?[
^]
string sdate = "Mon May 22 2017 12:48:00 GMT+0530 (India Standard Time)";
int bracketposition = sdate.IndexOf("(");
sdate = sdate.Substring(0,bracketposition-1).Trim();
sdate = sdate.Replace("GMT", "");
DateTimeOffset dto = DateTimeOffset.Parse(sdate);
Console.WriteLine("India standard time '{0}' => Local time: '{1}'", sdate, dto.ToLocalTime());
Console.WriteLine("India standard time '{0}' => Universal time: '{1}'", sdate, dto.ToUniversalTime());
Result:
India standard time 'Mon May 22 2017 12:48:00 +0530' => Local time: '2017-05-22 09:18:00 +02:00'
India standard time 'Mon May 22 2017 12:48:00 +0530' => Universal time: '2017-05-22 07:18:00 +00:00'