它需要两个参数(16 位整数),它们与DosDateTimeToFileTime的前两个参数
相同
您可以在 pywin32 的源代码 PyWinTypesmodule.cpp 中看到:
static PyObject *PyWin_DosDateTimeToTime(PyObject *self, PyObject *args)
{
WORD wFatDate, wFatTime;
if (!PyArg_ParseTuple(args, "hh", (WORD *)&wFatDate, (WORD *)&wFatTime))
return NULL;
FILETIME fd;
If (!DosDateTimeToFileTime(wFatDate, wFatTime, &fd))
return PyWin_SetAPIError("DosDateTimeToFileTime");
}
这些必须是此MSDN 链接中描述的格式,为方便起见,相关部分复制如下:
wFatDate [in]
The MS-DOS date. The date is a packed value with the following format.
Bits Description
0-4 Day of the month (1–31)
5-8 Month (1 = January, 2 = February, and so on)
9-15 Year offset from 1980 (add 1980 to get actual year)
wFatTime [in]
The MS-DOS time. The time is a packed value with the following format.
Bits Description
0-4 Second divided by 2
5-10 Minute (0–59)
11-15 Hour (0–23 on a 24-hour clock)