Quick question: I am trying to parse dates in the following format into their equivalent DateTime data type, but for some reason it does not work.
Line format: 28 / May / 2009: 17: 43: 04 +0000
Or: dd / MMM / yyyy: hh: mm: ss zz00
Here is the code I'm using:
Dim provider As New CultureInfo("en-US")
Dim d As DateTime = DateTime.ParseExact(value, "dd/MMM/yyyy:hh:mm:ss zz00", provider)
But this throws a FormatException.
FYI: I also tried using the InvariantCulture parameter for the ParseExact provider parameter, but to no avail.
Any pointers would be greatly appreciated; it's friday and my brain fell asleep! :)
Thanks!
source
share