|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
ISO Date FunctionsI need the following functions using the standards for Week Numbering IE
Week one is the first week with a thursday in it. getWeekStartDate( WeekNum as Integer , YearNumber as Integer ) as Date getWeekEndDate ( WeekNum as Integer , YearNumber as Integer ) as Date getWeekNumber ( dateToCheck as Date ) as Integer numWeeksInYear( year as Integer ) as Integer Does anyone know if there are these functions ? Cheers - here is the basis
Function getWeek1Monday(ByVal year As Integer) As Date Dim Jan1st As Date = New Date(year.ToString, 1, 1) If Jan1st.DayOfWeek <= DayOfWeek.Thursday Then Return DateAndTime.DateAdd(DateInterval.Day, 1 - Jan1st.DayOfWeek, Jan1st) Else Return DateAndTime.DateAdd(DateInterval.Day, 8 - Jan1st.DayOfWeek, Jan1st) End If End Function -- Show quoteHide quoteBest Regards The Inimitable Mr Newbie º¿º "Newbie" <m*@me.com> wrote in message news:uEApTftEGHA.2300@TK2MSFTNGP15.phx.gbl... >I need the following functions using the standards for Week Numbering IE >Week one is the first week with a thursday in it. > > getWeekStartDate( WeekNum as Integer , YearNumber as Integer ) as Date > getWeekEndDate ( WeekNum as Integer , YearNumber as Integer ) as Date > getWeekNumber ( dateToCheck as Date ) as Integer > numWeeksInYear( year as Integer ) as Integer > > Does anyone know if there are these functions ? > > Cheers - > > > > > |
|||||||||||||||||||||||