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

Formatting Date Output #182

Closed
paynecodes opened this issue Jul 16, 2016 · 2 comments
Closed

Formatting Date Output #182

paynecodes opened this issue Jul 16, 2016 · 2 comments
Labels

Comments

@paynecodes
Copy link

It seems that node-postgres is converting timestamptz strings from postgres into JavaScript date objects.

Upon stringification of this date object, JavaScript returns an IETF-compliant RFC 2822 timestamps such as "Fri Jul 15 2016 20:49:50 GMT-0400 (EDT)". I'd prefer that my API server return ISO 8601 string such as "2016-07-16T00:49:50.000Z".

It seems that this can be accomplished using the node-pg-types as @brianc suggests.

I'm not sure how to get direct access to pg-promise's pg dependency. Is this exposed? Is there a better way to go about doing this?

@vitaly-t
Copy link
Owner

vitaly-t commented Jul 16, 2016

@paynecodes
Copy link
Author

Oh, wow. I suppose I was just too deep to see what was right in front of me. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants