How to get Current week number (first Saturday of year is consider as first day of the year )

Hi Team, I hope all is well :slightly_smiling_face:

How to get Current week number (first Saturday of year is consider as first day of the year)

Thanks
Shaik

Hi,

How about the following expression?

Enumerable.Range(0,Now.DayOfYear).Count(Function(i) New DateTime(Now.Year,1,1).AddDays(i).DayOfWeek = DayOfWeek.Saturday)

Regards,

1 Like

@shaik.muktharvalli1
firstSaturday(DateTime) = Enumerable.Range(1, 7).Select(Function(d) New DateTime(Now.Year, 1, d)).Where(Function(day) day.DayOfWeek = DayOfWeek.Saturday).First()

currentWeek(Integer) = ((Now - firstSaturday).Days \ 7) + 1

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