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

Fix to return correct microsec for timestamp datatype #38

Merged
merged 1 commit into from
Jan 25, 2021

Conversation

shabbir10july
Copy link
Contributor

JIRA: #37

Problem:
nzpy returns Incorrect timestamp for below data in table :

DB1.ADMIN(ADMIN)=> select * from date_Table;
 ID |         DATE_DATA
----+----------------------------
  2 | 2012-10-15 12:57:18.000396

nzpy returns :

[nz@sim-ips26 python]$ python3 run4.py
['2012-10-15 12:57:18.396']

Solution:

  1. Added zero padding before microsec
  2. Removed unwanted code "fraction *= 1000"
  3. In few cases, dt param in timestamp2struct() is negative which calculates wrong date. Corrected division there.

Testing: Ran above test case. Ran nzpy testcases and nzalchemy+python testcases.

@abhishekjog abhishekjog merged commit 8d0e954 into master Jan 25, 2021
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

Successfully merging this pull request may close these issues.

2 participants