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
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
@somya177
CurrentDate= System.DateTime.Now
Delayed= CurrentDate.AddDays(3)
Both are DateTime variables here.
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.
Thanks,
Pradeep Sridharan
CurrentDate = DateTime.Now.ToString(“yyyy-MM-dd”)
Here, CurrentDate - string variable.
This gives output in the format you need.
2019-04-03.
But the date that needs to be passed will be 3 days after the currentdate and that to in this format
Delayed=DateTime.Today.AddDays(3)
//This gives the date after 3 days from Current date.
Delayedformatted=Delayed.ToString(“yyyy-MM-dd”)
//This gives the date in required format. 2019-04-03.
You can pass this variable to text field.
Got it?
yes…thanks
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.