Skip to content

The protobuf.Timestamp should turn to Date when call toObject ? #357

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

Closed
lawrsp opened this issue May 21, 2018 · 2 comments
Closed

The protobuf.Timestamp should turn to Date when call toObject ? #357

lawrsp opened this issue May 21, 2018 · 2 comments

Comments

@lawrsp
Copy link

lawrsp commented May 21, 2018

Is your feature request related to a problem? Please describe.

I'm always frustrated when I use node as a interface gateway, it call the backend with grpc, and reply to the client with json,
call message.toObject() always get the { seconds: XXX, nanos: XXXX} object with timestamp.
A standard json timestamp should be like "2017-05-04 T00:20:30Z", which is a javascript Date Object turned to be.

Describe the solution you'd like

we should change the protobuf.Timestamp.toObject() function to some like the toDate() function

@nicolasnoble
Copy link
Member

I don't think this feature request fits into this repository however. This belongs to either protobuf or protobufjs, I believe.

@murgatroid99
Copy link
Member

If you are using grpc.load or otherwise explicitly using the protobufjs package, you should file this issue with https://github.com/dcodeIO/protobuf.js. If you are using the google-protobuf package, you should file this issue with https://github.com/google/protobuf.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants