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
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
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.
Useful link below:
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.