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

pb.Timestamp convert Bson Date Missing precision #4

Open
imRainChen opened this issue Feb 24, 2021 · 2 comments
Open

pb.Timestamp convert Bson Date Missing precision #4

imRainChen opened this issue Feb 24, 2021 · 2 comments

Comments

@imRainChen
Copy link
Contributor

imRainChen commented Feb 24, 2021

pb.Timestamp.Now()
Seconds = {int64} 1614139173
Nanos = {int32} 948605000

after marshal
Seconds = {int64} 1614139173
Nanos = {int32} 948000000

@romnn
Copy link
Owner

romnn commented Feb 24, 2021

Thanks,

if you want to fix it or find out how the loss of precision comes about, here are the marshal and unmarshal functions: https://github.com/romnn/bsonpb/blob/master/v2/well_known_types.go#L650.

I currently do not have the time to look into it.

@imRainChen
Copy link
Contributor Author

OK, I found code. but not sure pb.Timestamp covert bson.Timestamp occurs something error.

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

No branches or pull requests

2 participants