Piotr Caban (@piotr) commented about dlls/msvcrt/time.c:
static const int MAX_SECONDS = 59; #endif
+#if _MSVCR_VER == 0 +#define MIN_GMTIME64_TIME 0 +#define MAX_GMTIME64_TIME _MAX__TIME64_T +#elif _MSVCR_VER >= 140 +#define MIN_GMTIME64_TIME -43200 +#define MAX_GMTIME64_TIME (_MAX__TIME64_T + 1605600) +#else +#define MIN_GMTIME64_TIME -43200 +#define MAX_GMTIME64_TIME (_MAX__TIME64_T + 46800) +#endif
Shouldn't we update the _MAX__TIME64_T value instead? It looks like the ranges could be also updated in other functions that use this (I didn't check if exact values match between _gmtime64, _wctime64 and _localtime64). Taking in account that the values change between dll version we probably don't have to support exactly the same range as native.
A quick test shows that _MAX__TIME64_T is not correct for _wctime64 in ucrtbase.