I want to get week number in year.
If I have variable int = 3 ( for use backward date)
today = 28/10/2021
I want to get week by date = 25/10/2021 ----> output = 44
Please guide me about it.
I want to get week number in year.
If I have variable int = 3 ( for use backward date)
today = 28/10/2021
I want to get week by date = 25/10/2021 ----> output = 44
Please guide me about it.
CultureInfo.CreateSpecificCulture(“en-US”).Calendar.GetWeekOfYear(New Datetime(2021,10,25), CalendarWeekRule.FirstFullWeek,DayOfWeek.Monday)
ensure
About the week rule enum also have a look here:
And here:
CultureInfo.InvariantCulture.Calendar.GetWeekOfYear(New Datetime(2021,10,25), CalendarWeekRule.FirstFourDayWeek,DayOfWeek.Monday)
@ppr If I want use variable in date month year.
How to edit code?
we would recommend following:
myDayVar similar to the dd from the screenshots
then just use the var within the statement:
CultureInfo.InvariantCulture.Calendar.GetWeekOfYear(checkDate,
CalendarWeekRule.FirstFourDayWeek,DayOfWeek.Monday)
@ppr I use follow your suggest.
But output is not correct.
output show : 43
But true number week must = 44 as below.
have a look on the provided screenshot from above where the calendarWeekRule was modified and showing 44. Same is to check for the dayOfWeek Settings if it has do to be adopted
One additional thing:
we can save a lot of time when prototyping directly on the immediate box. For further debugging options have a look here:
Understanding the 6 Debugging Panels of UiPath in the easiest way possible! - News / Tutorials - UiPath Community Forum
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.