I’m using .NET 3.5 and I have a date that comes in as string in the following format:
Tue Jan 20 20:47:43 GMT 2009
First question, what is the name of that format? Second question, what’s the easiest and clearest way to convert this string into a datetime? I would love to be able to use a .net API/Helper method if possible.
Edit: I forgot to mention that I’ve already tried using DateTime.Parse and Convert.ToDateTime. None of those worked.
You can use the DateTime.TryParseExact() method with a suitable format string. See here
EDIT: Try something like this: