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

Timestamp returns wrong values #302

Open
wgrientidev opened this issue Mar 29, 2023 · 0 comments
Open

Timestamp returns wrong values #302

wgrientidev opened this issue Mar 29, 2023 · 0 comments

Comments

@wgrientidev
Copy link

When retrieving a TIMESTAMP field from a Firebird database, node returns a bad value. (Wrong days and hours.)

function SQLVarTimeStamp() {}

SQLVarTimeStamp.prototype.decode = function(data, lowerV13) {
    var date = data.readInt();
    var time = data.readUInt();

    if (!lowerV13 || !data.readInt()) {
        var d = new Date(0);
     //   d.setMilliseconds((date - DateOffset) * TimeCoeff + Math.floor(time / 10) + d.getTimezoneOffset() * MsPerMinute);
        d.setMilliseconds((date - DateOffset) * TimeCoeff + Math.floor(time / 10) + 0 * MsPerMinute); // fix Timestamp Offset
        return d;
    }

    return null;
};

I managed to solve by changing this code.

#3

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