logo  How To find ISO Week Dates
This Chapter
Date Functions
Advent
Bank Hol (UK)
Chinese Calendar
Easter
Easter-Orthodox
Epoch Dates
Hebrew Calendar
Iso-Week Calendar
Nearest Weekday
Week Of Month
Other Dates
Chapters
Home Page
Colours, RGB
Computer Specifications
Dates&Times
Disk Drives
Files
Folders
GPS and OS Ref
VB.Net Forms
Image Files
If & Select
List/Array
Mathematics
NuGet
Sound
String Functions
Sun and Moon
User Controls
Validation
DigitalDan Sites
My Other Sites
Contact Site

Note
Some pages
may contain
inaccuracies
Hits=5
The International Standard week numbering system is ISO-8601. It specifies the following rules
Get ISO-Week Date relating to a Gregorian Date

Public Shared Function Gregorian_To_IsoWeek(date_Greg) As ISO_Week
 Dim ISO As ISO_Week
 ISO.yyyy = ISOWeek.GetYear(date_Greg)
 ISO.ww = ISOWeek.GetWeekOfYear(date_Greg)
 ISO.d = CInt(date_Greg.dayOfweek)
 If ISO.d = 0 Then ISO.d = 7 ' Sunday=0 in .Net Sunday=7 in ISO-Week
 ISO.IsoWeekDate = ISO.yyyy.ToString("0000") & "-W" & ISO.ww.ToString("00") & "-" & ISO.d.ToString("0")
 Return ISO
End Function

Public Structure ISO_Week
 Dim yyyy As Integer
 Dim ww As Integer
 Dim d As Integer
 Dim IsoWeekDate As String
End Structure
  
 
Get Gregorian Date relating to an ISO-Week Date

Public Shared Function IsoWeek_To_Gregorian(ISO_yyyy As Integer, ISO_ww As Integer, ISO_d As Integer) As Date
 Dim date_Greg As Date = ISOWeek.ToDateTime(ISO_yyyy, ISO_ww, ISO_d)
 ' fix time as midday - this avoids rare but obscure issues with clock changes etc.
 Return New Date(date_Greg.Year, date_Greg.Month, date_Greg.Day, 12, 0, 0, 0, 0)
End Function
  
 

DigitalDan.co.uk