Pass date to 3 days after current date

Hi All,

I want to pass a date into text field which should be 3 days after current date so if current date is 04/05/2019 then i need to write in text field 04/08/2019
Can anyone help in this

CurrentDate= System.DateTime.Now
Delayed= CurrentDate.AddDays(3)

Both are DateTime variables here.

1 Like

but my currentDate has to be passed as string as per requirement and the format of the date passed as string is “2019-04-02”

Convert the string variable to date and add the days and if you want to convert string again then find the attached XAML

Main.xaml (4.5 KB)

Hope it helps. Otherwise let me know.


Pradeep Sridharan

1 Like

CurrentDate = DateTime.Now.ToString(“yyyy-MM-dd”)

Here, CurrentDate - string variable.
This gives output in the format you need.

But the date that needs to be passed will be 3 days after the currentdate and that to in this format

//This gives the date after 3 days from Current date.

//This gives the date in required format. 2019-04-03.

You can pass this variable to text field.

Got it?


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