I cannot figure out how to convert the recording time returned as per below to a datetime. My code is:
Shell shell = new Shell();
Folder folder = shell.NameSpace("D:\Recorded Tv");
string recordingTime = folder.GetDetailsOf(WTVfile, 260);
string[] formats = { @"dd\/MM\/yyyy", @"d\/MM\/yyyy h:mm tt", @"d\/MM\/yyyy" };
DateTime recordingDateTime = DateTime.Now;
DateTime.TryParseExact(recordingTime, formats, CultureInfo.InvariantCulture, DateTimeStyles.None, out recordingDateTime);
The issue is that the string value in recordingTime for all intensive purposes looks fine to the naked eye, in the above case, "07/03/2014 7:30 PM" but it clearly is not being returned as I'm expecting as after the code above, recordingDateTime is "01/01/1000 12:00:00 AM"
If I copy the value in recordingTime to the clip board and paste it into the code pane and wrap it in rabbit's ears and go to save, it gives me a unicode warning.
My question is how do I parse the recordingTime string to be in the same culture?? as is expected by the TryParseExact method call?
I hope that's clearer :)
thanks
Matt