<% ' Calculate ISO week number ' ISO week 1 is the week containing the first Thursday of the year (or Jan 4th) ' Weeks start on Monday Dim fwToday, fiscalWeek, fwDayOfWeek, fwThursday, fwYear, fwJan4, fwWeek1Start, fwDaysFromStart

fwToday = Date()

' Find Thursday of current week (ISO weeks are identified by their Thursday) fwDayOfWeek = Weekday(fwToday, vbMonday) ' 1=Monday ... 7=Sunday fwThursday = DateAdd("d", 4 - fwDayOfWeek, fwToday)

' The year of the Thursday determines the ISO year fwYear = Year(fwThursday)

' Find January 4th of that year (always in week 1) fwJan4 = DateSerial(fwYear, 1, 4)

' Find Monday of the week containing Jan 4 (start of week 1) fwDayOfWeek = Weekday(fwJan4, vbMonday) fwWeek1Start = DateAdd("d", 1 - fwDayOfWeek, fwJan4)

' Calculate week number fwDaysFromStart = DateDiff("d", fwWeek1Start, fwToday) fiscalWeek = Int(fwDaysFromStart / 7) + 1 %>

##### West Jefferson

Fiscal Week
<%=fiscalWeek%>