Skip to content

Fix bad multiplier when writing some BSON datetimes#700

Merged
danielaparker merged 1 commit into
danielaparker:masterfrom
sandorzm:patch-1
Apr 29, 2026
Merged

Fix bad multiplier when writing some BSON datetimes#700
danielaparker merged 1 commit into
danielaparker:masterfrom
sandorzm:patch-1

Conversation

@sandorzm

Copy link
Copy Markdown
Contributor

Fix that basic_bson_encoder::visit_uint64 converted semantic_tag::epoch_nano-tagged integers to seconds, not milliseconds, before serializing as a BSON datetime. The resulting datetime would be much closer to 1970-01-01 (the Unix epoch) than it should. This commit copies the correct behavior from visit_int64 to visit_uint64.

Fix that basic_bson_encoder::visit_uint64 converted epoch_nano-tagged integers to seconds, not milliseconds, before serializing as a BSON datetime. The resulting datetime would be much closer to 1970-01-01 than it should. This commit copies the correct behavior from visit_int64 to visit_uint64.
@danielaparker danielaparker merged commit 7e25459 into danielaparker:master Apr 29, 2026
37 checks passed
@danielaparker

Copy link
Copy Markdown
Owner

Thanks for contributing!

@sandorzm sandorzm deleted the patch-1 branch April 30, 2026 14:53
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