rar.js icon indicating copy to clipboard operation
rar.js copied to clipboard

`parseEntryTime` need to multiply seconds by 2

Open as3long opened this issue 1 year ago • 0 comments

https://github.com/43081j/rar.js/blob/0d180e08a7f900ed0f153d3100a6ca9765a819dd/src/rar.ts#L123

private parseEntryTime(time: string) {
    if (time.length < 32) {
      time = (new Array(32 - time.length + 1)).join('0') + time;
    }
    const matches = time.match(/(\d{7})(\d{4})(\d{5})(\d{5})(\d{6})(\d{5})/);
    if (!matches) {
      return new Date();
    }
    const vals = matches.slice(1).map((val) => {
      return parseInt(val, 2);
    });
    return new Date(1980 + vals[0], vals[1] - 1, vals[2], vals[3], vals[4], vals[5] * 2);
  }

https://learn.microsoft.com/en-us/windows/win32/api/oleauto/nf-oleauto-dosdatetimetovarianttime

as3long avatar Jan 26 '24 08:01 as3long