Hi ,
I am getting date explicitly like (String) startDateStr= 14-03-2020 12:28:14 IST, now iam removing IST from that and storing it in cleanedStartDateStr(String)
now I want to convert that string format to DateTime format, for that I have done like below
but after converting to DateTime format I am getting result as 03/14/2020 12:28:14
but i need in a format of 14-03-2020 12:28:14 in DateTime type.
how can i fix this issue ? please help
You can’t get the output in DateTime variable because your preferred output is of the format dd-MM-yyyy HH:mm:ss so you will get the output dataType as System.String. If you want the output in System.DateTime DataType format variable your output will be of format MM/dd/yyyy HH:mm:ss.