Current week of the year

What is the simplest way to get the current week of year ?

1 Like

@vamsikrish28
Not sure what in detail you are looking for as the “current week” can be interpretated in more definitions (Week Number, Date Interval…)

Have a look on following, ensure System.Globalization is imported to the namespaces (right to Variable pannel)

CultureInfo.InvariantCulture.Calendar.GetWeekOfYear(DateTime.Now, CalendarWeekRule.FirstDay,DayOfWeek.Monday)
grafik

4 Likes

I want to compute the current week number of current year.

There might be 52 or 53 weeks in a year right, so I want which week(week number) we are currently in!!

this should be possible with the code line from above. Have a look also on the reference link for further configuration / Paramter info

2 Likes

Thanks a lot @ppr. Cheers and happy coding :smiley:

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