If I have date 26-07-2019 How can I get 01-07-2019 as an output
Hi, see below post
Maybe not the best looking solution but I’ll work.
Assign to your variable this:
Convert.ToDateTime(dateVariable.Month.ToString + "/01/" + dateVariable.Year.ToString)
I’m writing from my phone so I’ll double check the syntax if I were you, just in case!
EDIT: syntax updated
Scenario 1: First convert the given string date into DateTime Variable
2: Assign the new date to the variable of datetime
3. Return the Formated output string.
See image below for your reference