Changing yyyyMMdd to dd-MM-yyyy


How do I change the format of the date from yyyyMMdd to dd/MM/yyyy.
Although I can change from MM dd ,yyyy to dd/MM/yyyy, i could not change it from yyyyMMdd to dd/MM/yyyy. Please advice.


Hey @Lim_Jia_An
Could you please explain with an example?
Where are you fetching this date from?



First Parse the Date Time String to a dateTime Format

DateTime dt = DateTime.ParseExact(dateString, "yyyyMMdd", 

Then You can get the string of required format from a datetime variable
string A = dt.ToString(dd/MM/yyyy)



Here is a working example -

Main.xaml (5.5 KB)


Thank You!