Jacek Caban (@jacek) commented about dlls/vbscript/global.c:
+ } + + day1 = (LONG)date1; + day2 = (LONG)date2; + /* anchor is any day number whose day-of-week equals firstday_wday. + * Day 0 (12/30/1899) is Saturday (wday 6), so dow(d) = (d + 6) % 7. + * We need (anchor + 6) % 7 == firstday_wday, i.e. anchor = (firstday_wday + 1) % 7. */ + anchor = (firstday_wday + 1) % 7; + + /* Use floor division so negative day numbers are handled correctly */ + result = (LONG)floor((double)(day2 - anchor) / 7.0) + - (LONG)floor((double)(day1 - anchor) / 7.0); + } + else if(!wcsicmp(interval, L"h")) + { + result = (LONG)floor(date2 * 24.0) - (LONG)floor(date1 * 24.0);
result = floor(date2 * 24.0) - floor(date1 * 24.0);
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/10459#note_138894