Oğuz Türkay
unread,Jun 15, 2022, 2:48:39 PM6/15/22Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to grpc.io
I have a table in my database with createdAt, updatedAt, and deletedAt date columns and I want to send them to client in a proper format. I know there is a type for " timestamp" which google provides as google.protobuf.Timestamp. AFAIK when you use google.protobuf.Timestamp you have to format it like this
"{ seconds: 0, nanos: 0 }", and for example if we want to convert it to a JavaScript date object we'd have to do "new Date(seconds * 1000 + Math.round(nanos / 1e6))"
So I was wondering what is the best practice for dealing with timestamp while using gRPC and is sending just the milliseconds as string or uint64 without separating it into seconds an anti-pattern or bad practice.