-
Notifications
You must be signed in to change notification settings - Fork 14
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
Dates reduced by a few nanoseconds when sent to KDB #45
Comments
No idea why this is happening but in the meantime I've worked around it with the following very ugly hack:
I can afford to do this because I don't need time precision less than 1 second in this particular scenario. Still, would like to know why this is happening so I don't have to use such an ugly hack |
Hi @wwarby I see the output as expected:
node-q: latest As you can see, I have stopped using q / kdb+ since quiet a few years and never updated to an up-to-date version :) Regarding the time zone issue: set the timezone of your node process to UTC. q does not know about time zones. On Linux/macOS: |
Hi @michaelwittig, Very good of you to keep answering questions on this repo considering you're no longer using q / kdb+ :) So this does seem to be specific to some dates and not others - as far as I can tell, times that are precisely on the hour.
So the above should make it reproducible hopefully. I'm using Node v11.11, node-q latest, KDB+ latest (3.6), running Node on Windows 10. |
Interestingly I've also noticed that it's always off by precisely 128 nanoseconds - no more, no less. |
Could you, in
with
|
Hi Michael, sorry it took me a couple of days to get back to you on this but yes, I can confirm that the patch your provided above solves the problem - thanks :) So It's a bug in c.js then? I'll notify Kx but presumably you can fix it in the node-q library as c.js is an embedded library and not an npm dependency? |
c.js is heavily modified. I will provide a new release shortly |
released as Thanks for your bug report! |
Brilliant, thanks Michael |
Somehow my dates are being corrupted by tiny margins when they are sent to a KDB process. In the very simplest form I can demonstrate the problem with this code:
Output in KDB:
The date is also off by an hour but I haven't tried dealing with the timezone issue yet - for now I need to deal with the weirdness in the nanoseconds. Any ideas why this is happening?
The text was updated successfully, but these errors were encountered: