1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.epochMillisFromMillisSince2001_01_01 = epochMillisFromMillisSince2001_01_01;
|
4 | exports.epochMillisFromMillisSince2001_01_01Buffer = epochMillisFromMillisSince2001_01_01Buffer;
|
5 | const tslib_1 = require("tslib");
|
6 | const assert_1 = tslib_1.__importDefault(require("assert"));
|
7 | const tlv_1 = require("./tlv");
|
8 | const EPOCH_MILLIS_2001_01_01 = Date.UTC(2001, 0, 1, 0, 0, 0, 0);
|
9 |
|
10 |
|
11 |
|
12 | function epochMillisFromMillisSince2001_01_01(millis) {
|
13 | return EPOCH_MILLIS_2001_01_01 + millis;
|
14 | }
|
15 |
|
16 |
|
17 |
|
18 | function epochMillisFromMillisSince2001_01_01Buffer(millis) {
|
19 | (0, assert_1.default)(millis.length === 8, "can only parse 64 bit buffers!");
|
20 | const millisSince2001 = (0, tlv_1.readUInt64LE)(millis);
|
21 | return epochMillisFromMillisSince2001_01_01(millisSince2001);
|
22 | }
|
23 |
|
\ | No newline at end of file |