Function to obtain the value of the week from the date and time value.

 

Syntax

function WeekOf(dt: double): integer;

 

Parameters and return values

Parameter

Type

Value

dt

double

date/time value from which you need to obtain a numeric value of the week.

 

Function result

Returns the week of the year.

 

Example


var
  iWeek: integer;
begin
  iWeek := WeekOf(Now);
  
  mLogScript('Current week number is: ' + inttostr(iWeek), '');
end.


Script work result

[22:05:24] (Log "WeekOf"): Current week number is: 44

 

See also

IntToStr

mLogScript

Now