balderdashy / balderdashy/sails
Stop automatic conversion of datetime field to UTC time zone and ISO format
- Dominant language
- JavaScript
- Stars
- 22.8k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
**Node version**: : 10
**Sails version** _(sails)_: 1.4
**ORM hook version** _(sails-hook-orm)_: 2.1.1
**Sockets hook version** _(sails-hook-sockets)_: 2.0.0
**Organics hook version** _(sails-hook-organics)_: 2.2.0
**DB adapter & version** _(e.g. sails-mysql@5.55.5)_: sails-postgresql@2.0.0
Hello Team,
I have field called order_date with a column_type : timestamp and type : ref.
Now inserting of data of whatever date and time I'm giving is fine but while fetching of that data, it is automatically converting that timestamp field value to UTC time and giving an ISO date format like this one : "2020-11-07T04:30:00.000Z", what I have insert is this : "2020-11-07 10:00:00". And selecting query in database is giving the same value without time zone as I have inserted, while using your ORM data the result is different as you can see.
Can you tell me a solution for the same ?
Contributor guide
Research direction
Reproduce the fetch behavior with Sails 1.4, sails-hook-orm 2.1.1, and sails-postgresql@2.0.0 using an order_date ref field and the supplied timestamp values. Before making changes, establish whether the expected result is to preserve the database value, the timezone, the format, or provide configuration; done requires an agreed behavior and a regression check.
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
- 32/100