Skip to content

Incorrect values for DateTimeOffset #8

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

Closed
patriksimek opened this issue Dec 18, 2015 · 3 comments
Closed

Incorrect values for DateTimeOffset #8

patriksimek opened this issue Dec 18, 2015 · 3 comments

Comments

@patriksimek
Copy link

Originally posted here: Azure/node-sqlserver#160

var msnodesql = require('msnodesqlv8');
msnodesql.open(connectionString, function(err, conn) {
    if (err) return console.error(err);

    conn.query("select convert(datetimeoffset(7), '2014-02-14 22:59:59.9999999 +05:00') as dto1, convert(datetimeoffset(7), '2014-02-14 17:59:59.9999999 +00:00') as dto2", function(err, res) {
        console.log(res);
    });
});

Got:

[ { dto1: { Sat, 15 Feb 2014 03:59:59 GMT nanosecondsDelta: 0.0009999 },
    dto2: { Fri, 14 Feb 2014 17:59:59 GMT nanosecondsDelta: 0.0009999 } } ]

Expected:

[ { dto1: { Fri, 14 Feb 2014 17:59:59 GMT nanosecondsDelta: 0.0009999 },
    dto2: { Fri, 14 Feb 2014 17:59:59 GMT nanosecondsDelta: 0.0009999 } } ]
@TimelordUK
Copy link
Owner

OK, I will try to take a look at this issue - looks like the driver is incorrectly applying offset based on what you are seeing, I will dig a bit deeper and report back to you.

@TimelordUK
Copy link
Owner

I have added this test into the date suite and it now passes OK on my system. Please update and try, let me know if there are still problems. This required a change in the cpp driver itself.

@patriksimek
Copy link
Author

Thanks, my tests are passing now.

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

2 participants