Date Time conversion

I have the date time comes as a string like “12May2019”. I need to convert this to “dd-mm-yyyy” format.

please raise your suggestions.

1 Like

Hi @jishnupnair1996

check below screen shot change string to date format

I have created workflow based on your requirement run and check let me know.

Date.zip (10.8 KB)

DateString.toString(“dd-MM-yyyy”)

1 Like

1 Like

An error shows as “string was not recognized as valid Date Time Format”

not working

try this : CDate(“12May2019”).tostring(“dd-MM-yyyy”)
please note mm stand for minutes and MM stand for month…

1 Like

try this bro

1.use assign datestr=“12May2019”
2.assign out_date=Date.ParseExact(datestr.Trim,“ddMMMyyyy”,Globalization.CultureInfo.InvariantCulture).ToString(“dd-MM-yyyy”)

Buddy @jishnupnair1996,

input_datetime = “12May2019”

Output_Time = Datetime.Parseexact(input_datetime,“ddMMMyyyy”,System.Globalization.CultureInfo.InvariantCulture)

Just two steps buddy @jishnupnair1996


Simple buddy…this worked…
Cheeerss s…



image

hello @jishnupnair1996
take an assign activity create a System.DateTime Variable & on the right hand side type this command Convert.ToDateTime(“12May2019”).

Did that work for you buddy @jishnupnair1996

Hi @jishnupnair1996,

This solution also work.

convert.ToDateTime("12May2019").ToString("dd-MM-yyyy")

image

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.