Closed thuandoan274 closed 6 years ago
Hi @thuandoan274,
The JSONMarshaller follows the RFC3339Nano standard that can handle nanoseconds: https://golang.org/pkg/time/#Time.MarshalJSON . However, take into account that in your case both are the same date since 50.760
seconds is the same value as 50.76
seconds. Therefore your trailing 0 will not be shown.
You can always write your own Marshaller to behave the way you want it to.
Since this is not a problem in the driver, but a design choice by the Golang language I will close this issue.
Oscar
What did you do?
I'm using mongodb, and I have field createdAt like this
What did you expect to see?
I want when I get json it will response like this
What did you see instead?
I see it seem like golang omit the zero last
It make mobile team I working with crash, because It's not follow the format the defined. Show anyone can help how can I response the zero miliseconds, I want a general solution for my project!