I want to convert the date from Jul 6, 2018 to MM/dd/yyyy

I have been fetching the date from Excel and the date is in this format Jul 6, 2018 and I want to convert to MM/dd/yyyy.

Please suggest me

Convert.ToDateTime(StrdateVariable).ToString(“MM/dd/yyyy”)

Assuming you have the date Jul 6, 2018 in a variable StrdateVariable

1 Like

@PRAVEENTHUYAMANI

Check as below

Thanks

1 Like

Hi @PRAVEENTHUYAMANI,

You can use this - Convert.ToDateTime(dt.ToString(“MM/dd/yyy”)) , where dt is DateTime variable.

(or)

dateInput = jul 6,2018

DateTime.ParseExact(dataInput,“MMM dd, yyyy”,System.Globalization.CultureInfo.InvariantCulture).ToString(“MM/dd/yyyy”)

Please find the attached xaml for you reference.

DateConversion.xaml (5.4 KB)

Hope this helps,if it works, mark it as solution.

Thanks,
Neelima.

2 Likes

Hi @PRAVEENTHUYAMANI,

Useful link below:

1 Like

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