Hi
I have a string deploy=“11/03/2019 5:00PM GMT”
I want to convert to specfic format 20190311
format=“dd/MM/yyyy”
convert_Date=DateTime.ParseExact(deploy.Split()(0).ToString,formatconversion,System.Globalization.CultureInfo.CurrentUICulture.DateTimeFormat).toString(yyyyMMdd) this var is of OBJ type.
you were almost done the expression will be like DateTime.ParseExact(Split(deploy," ")(0).ToString,“MM/dd/yyyy”,System.Globalization.CultureInfo.invariantculture).tostring(“yyyyMMdd”)
awesome
then use this sequence to do this
–use a IF condition like this str_input.Length.Equals(10)
if this is true it will go to THEN part where use this expressiion DateTime.ParseExact(Split(deploy," ")(0).ToString,“MM/dd/yyyy”,System.Globalization.CultureInfo.invariantculture).tostring(“yyyyMMdd”)
or if its false it will go to ELSE part where use this expression DateTime.ParseExact(Split(deploy," ")(0).ToString,“M/dd/yyyy”,System.Globalization.CultureInfo.invariantculture).tostring(“yyyyMMdd”)