Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parseEntryTime need to multiply seconds by 2 #21

Open
as3long opened this issue Jan 26, 2024 · 0 comments
Open

parseEntryTime need to multiply seconds by 2 #21

as3long opened this issue Jan 26, 2024 · 0 comments

Comments

@as3long
Copy link

as3long commented Jan 26, 2024

private parseEntryTime(time: string) {

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant