I have a string that looks like 2017:10:08 13:01:14 and simply need to convert it into an acceptable DateTime format for inserting into a SQL Server field of type datetime.
I would prefer to use something simple and flexible like
...but that is not working. I have also triedCode:DateTime.Parse(datevar)
which is not working either. Any help you can provide is appreciated!Code:DateTime.ParseExact(datevar, "yyyy:MM:dd HH:mm:tt", Nothing)




Reply With Quote
