-
Notifications
You must be signed in to change notification settings - Fork 215
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
Function strftime
prints imprecise fractional seconds
#1152
Comments
Function
|
Here is a verbose workaround:
|
Even if we're upshifting all micro-second (
even if one wants to play it safe and only use signed 52-bits instead of 53, that's still a very wide range of timestamps that could be fully represented and calculated internally as integers, and only dividing it by
for all practical purposes, a date-time library covering plus or minus 100 years more than suffices, especially when it's allowing for microsecond timestamps (and those who seek the full ranges could easily call migrating them to integers internally basically require zero changes to the rest of your logic flow, upshifting them once at read-in, and downshifting them once at write-out. ** few systems offer true and precise nanoseconds - microsec more than suffices for most usage scenarios (unless this is used for something very specialized like HF-trading platforms or tracing subatomic particle motion at LHC or something) |
Are you recommending that Miller migrate floating point seconds with nanosecond precision to integer nanoseconds? |
strftime
prints imprecise fractional seconds
@mogando668 @derekmahar the The best way I see to implement the excellent advice on this issue is to make new |
Do you mean that the Go implementations of
Would there be any disadvantage to implementing |
No. Go internally uses a format which is quite fine with regard to precision. The issue is that the Miller functions use floating-point:
Agreed, that would be quite nice :) Signed 64-bit ints with nanoseconds still gives us centuries past (or before) the epoch which would suffice. :) |
@derekmahar @mogando668 can you take a look a head now that #1326 is merged? |
After building Miller at commit d72ef826fb5ecc41a4cde0d0fcb2402082b83ca1:
For all three cases, the actual result matches the expected result. |
Repeating the same tests for
|
Thanks for adding nanosecond resolution! This preserves nanoseconds in the timestamp
It would be nice to have
Then I could say
|
OK @zmajeed this is awesome feedback! I think we can make this happen |
I think this is everything -- @derekmahar @zmajeed @mogando668 please let me know if I missed anything and we can reopen -- thank you! |
Amazing! Didn't expect you to jump on this - I should have given more details The The |
Thanks @zmajeed ! |
Some references GNU date time format specifiers - https://www.gnu.org/software/coreutils/manual/html_node/Time-conversion-specifiers.html |
@derekmahar I believe this issue is resolved by: |
Thanks @derekmahar ! |
In Miller 6.5.0, function
strftime
prints imprecise fractional seconds:Expected result:
date_and_time=2016-01-30T17:52:22.303
Expected result:
date_and_time=2016-01-30T17:52:22.303000
Expected result:
date_and_time=2016-01-30T17:52:22.303000000
I might have reported this behaviour in a comment on an earlier issue or discussion related to
strftime
orstrptime
, but I can't find the comment. Anyway, I think this behaviour deserves its own separate issue.The text was updated successfully, but these errors were encountered: