Skip to content

Commit 086b0a7

Browse files
committed
Use UTC in generating DOS date
1 parent 744af18 commit 086b0a7

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

lib/archivers/zip/util.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var Int64 = require('node-int64');
99
var util = module.exports = {};
1010

1111
util.dateToDos = function(d) {
12-
var year = d.getFullYear();
12+
var year = d.getUTCFullYear();
1313

1414
if (year < 1980) {
1515
return 2162688; // 1980-1-1 00:00:00
@@ -19,11 +19,11 @@ util.dateToDos = function(d) {
1919

2020
var val = {
2121
year: year,
22-
month: d.getMonth(),
23-
date: d.getDate(),
24-
hours: d.getHours(),
25-
minutes: d.getMinutes(),
26-
seconds: d.getSeconds()
22+
month: d.getUTCMonth(),
23+
date: d.getUTCDate(),
24+
hours: d.getUTCHours(),
25+
minutes: d.getUTCMinutes(),
26+
seconds: d.getUTCSeconds()
2727
};
2828

2929
return ((val.year - 1980) << 25) | ((val.month + 1) << 21) | (val.date << 16) |

0 commit comments

Comments
 (0)