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 currently doesn't handle fractional seconds part #15

Open
geomaniac opened this issue Sep 14, 2018 · 0 comments
Open

Timestamp currently doesn't handle fractional seconds part #15

geomaniac opened this issue Sep 14, 2018 · 0 comments

Comments

@geomaniac
Copy link
Member

geomaniac commented Sep 14, 2018

This means inserting a date like 2018-09-14T12:33:21.831371900 will be stored and later retreived as 2018-09-14T12:33:21.

This is caused by us using SQLT_DAT as host type, which doesn't have below second precision.

Possible solution 1: Use strings

Using SQLT_CHR and use the standard string representation to convert between NativeDateTime and Timestamp.

Need to set NLS_TIMESTAMP_FORMAT to set the format correctly. Like so:

ALTER SESSION SET NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD"T"HH:MI:SS.FF';

Possible solution 2: Use oci datetime class

Using SQLT_TIMESTAMP and OCIDateTime .

https://docs.oracle.com/database/121/LNOCI/oci12oty.htm#LNOCI16842

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

No branches or pull requests

1 participant