If sunday, +1day is Monday

Hello all,

I read excel file to get date at cell D15: 09/10/2022 and type in app. but this is Sunday how it can know to +1 day is Monday 10/10/2022
→ If sunday auto change monday.

Datetime.ParseExact(in_DataTableDLV030.Rows(0)(3).ToString.SubString(0,10).Trim, “dd/MM/yyyy”, System.Globalization.CultureInfo.InvariantCulture).ToString(“MMddyyyy”)

image

Hi,

Can you try the following step?

varDateTime = Datetime.ParseExact(in_DataTableDLV030.Rows(0)(3).ToString.SubString(0,10).Trim, “dd/MM/yyyy”, System.Globalization.CultureInfo.InvariantCulture)

Then check if it’s Sunday. Condition is

varDateTime.DayOfWeek=DayOfWeek.Sunday

If Sunday, use AddDays method

varDateTime = varDateTime.AddDays(1)

Finally convert it to dd/MM/yyyy style string.

varDateTime.ToString("dd/MM/yyyy")

Regards,

3 Likes

hey,

Can you try below workflow for check on given date is sunday or not if it sunday then you can add +1 for next day i.e monday
variable data type is dateTime


refer log
image

syntax for +1

1 Like

Hello @anh.nguyen

You can use Modify date activity to achieve this.

Thanks

1 Like

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