Hello guys i am trying to convert date time string “20200805 055959” to "“05-08-2020 05:59:59"”
using DateTime.ParseExact(StringDateStamp, “yyyymmdd hhmmss”, Nothing).ToString(“dd-mm-yyy hh:mm:ss”)
its not working, please someone help me out , i think i am missing something
I think you want DateTime.ParseExact(StringDateStamp, “yyyymmdd hhmmss”, System.Globalization.CultureInfo.Invariantculture).ToString(“dd-mm-yyyy hh:mm:ss”).
Oh it worked , i had to capitalize the HH time and the MM for months. I am surprised. do capitalization really matter when writing this code
Here is it now
DateTime.ParseExact(“20200805 055959”, “yyyyMMdd HHmmss”, System.Globalization.CultureInfo.Invariantculture).ToString(“dd-mm-yyyy HH:mm:ss”)