I have stringone that contains: December 14, 2011 9:45 am (note that "AM" is not uppercase ")
Now I wanted to create a variable with it datetime.
I tried to look, but this is the opposite of what I wanted. I also tried this one but could not. I have tried so far the following:
Dim dateNow As DateTime
Dim out As String = "14 Dec 2011 9:45 am"
dateNow = DateTime.ParseExact(out, "d MMM yyyy HH:mm tt", Nothing)
But, unfortunately, this does not work. Any ideas? Thank you VB.net Or C # code will be fine ..
source
share