mirror of
https://github.com/gradle/actions.git
synced 2025-12-08 17:15:46 +08:00
publishing v1 of action
This commit is contained in:
13
node_modules/unzipper/lib/parseDateTime.js
generated
vendored
Normal file
13
node_modules/unzipper/lib/parseDateTime.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
// Dates in zip file entries are stored as DosDateTime
|
||||
// Spec is here: https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-dosdatetimetofiletime
|
||||
|
||||
module.exports = function parseDateTime(date, time) {
|
||||
const day = date & 0x1F;
|
||||
const month = date >> 5 & 0x0F;
|
||||
const year = (date >> 9 & 0x7F) + 1980;
|
||||
const seconds = time ? (time & 0x1F) * 2 : 0;
|
||||
const minutes = time ? (time >> 5) & 0x3F : 0;
|
||||
const hours = time ? (time >> 11): 0;
|
||||
|
||||
return new Date(Date.UTC(year, month-1, day, hours, minutes, seconds));
|
||||
};
|
||||
Reference in New Issue
Block a user