Skip to content

Commit 718f0db

Browse files
committed
lib: timezone bugfix
1 parent 02719c7 commit 718f0db

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

lib/decode.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
var assert = require('assert');
33
var values = require('./values');
44

5-
var appleEpoch = (new Date(1904, 0, 1)).getTime();
5+
var appleEpoch = Date.UTC(1904, 0, 1);
66
var appleDate = function (value) {
77
return new Date(appleEpoch + (value * 1000));
88
};

lib/encode.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var util = require('util');
33
var assert = require('assert');
44
var values = require('./values');
55

6-
var appleEpoch = (new Date(1904, 0, 1)).getTime();
6+
var appleEpoch = Date.UTC(1904, 0, 1);
77
var appleDate = function (value) {
88

99
if (util.isDate(value) === false) {

test/basics.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe('decode', function () {
2525

2626
assert.deepEqual(info.volume, {
2727
name: 'Test Title',
28-
created: new Date('2014-01-02T17:20:04.000Z'),
28+
created: new Date('2014-01-02T18:20:04.000Z'),
2929
signature: 'H+',
3030
type: 'other',
3131
abspath: '/Volumes/Test Title'
@@ -40,7 +40,7 @@ describe('decode', function () {
4040
type: 'file',
4141
filename: 'TestBkg.tiff',
4242
id: 20,
43-
created: new Date('2014-01-02T17:20:08.000Z'),
43+
created: new Date('2014-01-02T18:20:08.000Z'),
4444
path: 'Test Title:.background:',
4545
abspath: '/.background/TestBkg.tiff'
4646
});

0 commit comments

Comments
 (0)