Share this page 

Obtain the week of the yearTag(s): Powerscript


// a week # (1-53) 
Date ld_today, ld_januaryFirst
int  li_year
long ll_weekOfTheYear
dt_today = Today()
li_year = Year(ld_today)
ld_januaryFirst = Date( String( li_year ) + '-01-01' )
ll_weekOfTheYear = Int( ( DaysAfter(ld_januaryFirst, Date(ld_date)) + &
        DayNumber(ld_januaryFirst) ) / 7) + 1