Convert String to Datetime Var

I need to convert dates in the following String format: “1/8/2020” into date time variable

Then i also want to know how I can increment the date

Then How do I convert it back to a string in the following format: d/mm/yyyy
Please let me know

@Sami_Syed
String to DateTime:
Date.ParseExact(yourStringVar, “d/MM/yyyy”,CultureInfo.InvariantCulture)

ensure System.Globalization namespace is imported

Increment Date
(e.g. Add 1 day, other AddXX Functions are available as well
yourDateTimeVariable.AddDays(1)

DateTime to String:
yourDateTimeVariable.ToString(“d/MM/yyyy”)

1 Like

grafik

1 Like

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