DateTime.WeekOfYear

From Xojo Documentation

Read-Only Property (As Integer )
IntegerValue = aDateTime.WeekOfYear

New in 2019r2

Supported for all project types and targets.

The number of the week of the year the date falls in.

Notes

The first week is numbered 1. The first week may be incomplete. If January 1 falls on a Saturday, then the next day is in week 2.

Sample Code

The following code displays the current week of the year.

Var d As DateTime = DateTime.Now
MessageBox("Week: " + d.WeekOfYear.ToString)