Hi,
I need to format a date with the next format and I don’t know how to:
Sun, 28 Mar, 2021
Hi,
I need to format a date with the next format and I don’t know how to:
Sun, 28 Mar, 2021
in case of a variable of datatype DateTime is present or now can be used with toString we can format:
YourDateTimeVar.toString(“ddd, dd MMM, yyyy”)
in case of a date string is to reformat
@Victor_Lozano
Check this below code,
DateTime.ParseExact(“Sun, 28 Mar, 2021”,“ddd, dd MMM, yyyy”, System.Globalization.CultureInfo.InstalledUICulture).ToString(“dd-MM-yyyy”)
Output : 28-03-2021
Hope this may help you
Thank u, u know any good tutorial to know how to format strings?
official references is a good information resource:
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.