MCPcopy Create free account
hub / github.com/Squirrel/Squirrel.Windows / dosdatetime2filetime

Function dosdatetime2filetime

src/Setup/unzip.cpp:3732–3745  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3730}
3731
3732FILETIME dosdatetime2filetime(WORD dosdate,WORD dostime)
3733{ // date: bits 0-4 are day of month 1-31. Bits 5-8 are month 1..12. Bits 9-15 are year-1980
3734 // time: bits 0-4 are seconds/2, bits 5-10 are minute 0..59. Bits 11-15 are hour 0..23
3735 SYSTEMTIME st;
3736 st.wYear = (WORD)(((dosdate>>9)&0x7f) + 1980);
3737 st.wMonth = (WORD)((dosdate>>5)&0xf);
3738 st.wDay = (WORD)(dosdate&0x1f);
3739 st.wHour = (WORD)((dostime>>11)&0x1f);
3740 st.wMinute = (WORD)((dostime>>5)&0x3f);
3741 st.wSecond = (WORD)((dostime&0x1f)*2);
3742 st.wMilliseconds = 0;
3743 FILETIME ft; SystemTimeToFileTime(&st,&ft);
3744 return ft;
3745}
3746
3747
3748

Callers 1

GetMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected