I want to print the date that comes one day after the date

hello, I have an automation that reads a date from a site. I want to print the date that comes one day after the date it reads from the site in the message box, how can I achieve this?

before data → 17/03/2023
after data → 18/03/2023

@Arzu_Kaya so you want to add one day in date that you are reading from site?

For that please try
Next Day - varDateTime.AddDays(1).Tostring(“dd-MM-yyyy”)
Previous Day - varDateTime.AddDays(-1).Tostring(“dd-MM-yyyy”)

Hi @Arzu_Kaya

give a try with

DateTime.ParseExact(strInput, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).AddDays(+1).ToString("dd/MM/yyyy")

image

Regards

The AddDays function cannot be displayed because I am reading data from an Excel. this is how i get data from excel

Split(CurrentRow.Item(4).ToString, " ")(0).ToString

Where do I need to add what you wrote, this is how I assign data from excel.
Split(CurrentRow.Item(4).ToString, " ")(0).ToString

DateTime.ParseExact(Split(CurrentRow.Item(4).ToString, " ")(0).ToString, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).AddDays(+1).ToString("dd/MM/yyyy")

Regards

Thanks, may I ask you more questions with your permission? I sent a link request, I would appreciate it if you accept it

You can create more topics, if i can help you i will be there, if not more people will came to help!

1 Like

This is the way :slight_smile:

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