I have got a time format from a file in this format "03:45:00 AM CST" from a column record. Additionally I have to convert this into utc and then to est time zone or local system's time. I have tried this approach so far but all in vein. Any help would be appreciated.
//Converting Time in CST to UTC
f= "03:45:00 AM CST"
var fetchtime = f.Substring(0,12);
var converttimetostring = Convert.ToDateTime(fetchtime).ToString();
var timeconvert = DateTime.ParseExact(converttimetostring,"HH:mm:ss",CultureInfo.InvariantCulture);
DateTime timeUtc = DateTime.UtcNow;
TimeZoneInfo cst = TimeZoneInfo.FindSystemTimeZoneById("Central Standard Time");
DateTime cstTime = TimeZoneInfo.ConvertTimeToUtc(timeconvert,cst);
Console.WriteLine(cstTime);
//Converting time FROM UTC to EST(East. Standard Time)
DateTime localtime = cstTime.ToLocalTime();
Console.WriteLine(localtime);