Skip to content

query: encode unix milliseconds before 1970 - #193

Open
SashaMIT wants to merge 1 commit into
google:masterfrom
SashaMIT:fix/unixmilli-before-epoch
Open

SashaMIT wants to merge 1 commit into
google:masterfrom
SashaMIT:fix/unixmilli-before-epoch

Conversation

@SashaMIT

@SashaMIT SashaMIT commented Oct 2, 2026 •

Copy link
Copy Markdown

Summary

unixmilli divided UnixNano by 1e6. That division truncates toward zero, so 1969-12-31 23:59:59.000000001 was encoded as -999. The millisecond is -1000.

A time after 1970 is unchanged. 2000-01-01 12:34:56 is still 946730096000.

Test plan

  • go test -count=1 ./query/

UnixNano divided by 1e6 truncates toward zero, so a time one
nanosecond after 1969-12-31 23:59:59 was encoded as -999 instead
of -1000.

Signed-off-by: Sasha Mitchell <sash.t.mitchell@gmail.com>
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.

1 participant