Hi.

It´s easy you only need to think how you woud do it your self.

Firts you need the check how many time ( in seconds ) has passed between the beguining off the year in question.
Them you need to calc the seconds since the beguinning off the year until today.
After that you need only to calc the seconds for 604800 ( that it´s in seconds the duration off a week)

Code:
alias weeks {
  ;This will return the beguin ctime yearon this case 01/01/08 at 00:00:00 hours
  var %x $ctime( $+( 01/01/, $date(yy)) 0:00:00)
  ;This will calculate the seconds between the beguining off the year until this hours off today
  var %x $calc( $ctime - %x)
  ;This will calculate the nr off weeks, until today
  ;In this example i will use the duration becouse he tell me the week.
  return $gettok( $duration( %x, 1), 1, 32)
}

; You can use always a calc that don´t need the $duration identifier
;Knowing that one week has 604800 seconds them you will divide the total duration until know ( in seconds), and you will obtain the exacle week´s.
;We use the $int idntifier to return the integer part off the calculation.
return $int( $calc( %x / 604800))


Good luck

Last edited by Miguel_A; 02/03/08 01:58 PM.