I am reading Exif data and my DateTime is retrieved and converted to string from ascii and is of the form "2011:05:11 21:28:56" or with the format "yyyy:MM:dd HH:mm:ss". The relevant code snippet is posted below. VB.Net 2010 complains that the "String was not recognized as a valid DateTime."
'Set up for conversion of datetime
Dim provider As CultureInfo = CultureInfo.InvariantCulture
Dim format As String = "yyyy:MM:dd HH:mm:ss"
Dim prop As String
prop = encoding.GetString(propItems(count).Value) 'Run the Ascii Encoding
Dim date1 As DateTime = DateTime.ParseExact(prop, format, provider) 'Converts from string to DateTime
Any clue as to what I might be doing wrong? Thanks
'Set up for conversion of datetime
Dim provider As CultureInfo = CultureInfo.InvariantCulture
Dim format As String = "yyyy:MM:dd HH:mm:ss"
Dim prop As String
prop = encoding.GetString(propItems(count).Value) 'Run the Ascii Encoding
Dim date1 As DateTime = DateTime.ParseExact(prop, format, provider) 'Converts from string to DateTime
Any clue as to what I might be doing wrong? Thanks