Для текущей даты:
CODE:external(INT, "strftime", "strftime", "msvcrt.dll");
external(INT, "localtime", "_localtime32_s", "msvcrt.dll");
external(INT, "time", "time", "msvcrt.dll");
int Week = GetNumberWeek();
messagebox(Week);
function GetNumberWeek()
{
int timestamp = time(0);
int tm[9];
char buffer[3];
localtime(address(#tm[0]), address(#timestamp));
strftime(address(#buffer[0]), sizearray(buffer), "%W", address(#tm[0]));
return formatsn(format(#buffer[0]));
} |