Get dates of current week by inputting today's date

Hello Community,

Need help…!!

I want to get ongoing weeks - all dates.
Can anyone quickly help on this with the logic in Uipath?

@balupad14 @aksh1yadav @loginerror @ovi

1 Like

Monday: Now.AddDays(2 - Weekday(Now))
Tuesday: Now.AddDays(3 - Weekday(Now))
Wednesday: Now.AddDays(4 - Weekday(Now))
Thursday: Now.AddDays(5 - Weekday(Now))
Friday: Now.AddDays(6 - Weekday(Now))
Saturday: Now.AddDays(7 - Weekday(Now))
Sunday: Now.AddDays(1 - Weekday(Now))


If I got you right you would like to 7 days (Mon-Sun) from week within today is:

Assign Activity
left side: List (Of DateTIme) WeekDays
right side: Enumerable.Range(0,7).Select(Function (x) Today.AddDays(x - today.DayOfWeek + 1)).toList

GetAllWeekdays_byToday.xaml (4.3 KB)


Thanks for the solution Anthony :slight_smile:

Thanks Peter, it was all needed :innocent:

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