balderdashy / balderdashy/sails
Postgresql without timezone : sails change it
- Dominant language
- JavaScript
- Stars
- 22.8k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
**Sails version**: 1.1.0
**Node version**: 9.8.0
**NPM version**: 5.7.1
**DB adapter name**: sails-postgresql
**DB adapter version**: 1.0.2
**Operating system**:Windows
Hi,
I spent a lot of time to search any solution.
I think there is a "bug" or someting missing in configuration.
I store data in a timestamp without time zone, like this : 2019-03-15 00:00:00
Everything is okay in DB.
In sails model, the sendNativeQuery method returns 2019-03-14T23:00:00.000Z.
I tried to put "process.env.TZ = 'UTC';" in bootstrap.js file, it's not working. Same for timezone parameter in datastore.js with sails-postgresql adapter.
So, I think timezone is not implemented in sails, that's a problem.
Many thanks,
Contributor guide
Research direction
Start with the reported sendNativeQuery behavior and compare the timezone settings attempted in bootstrap.js and datastore.js, using the sails-postgresql adapter context. Reproduce the conversion from a timestamp without time zone and establish the expected returned value; done means the timezone behavior is documented or corrected with a verified reproduction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js, postgresql
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100