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

DataType.TIME doesn't insert into Postgres correctly #13276

Closed
2 of 7 tasks
sebastiankade opened this issue May 18, 2021 · 1 comment
Closed
2 of 7 tasks

DataType.TIME doesn't insert into Postgres correctly #13276

sebastiankade opened this issue May 18, 2021 · 1 comment
Labels
stale status: understood For issues. Applied when the issue is understood / reproducible. topic: dates & times For issues and PRs. Things that involve dates and times. type: bug

Comments

@sebastiankade
Copy link

Issue Description

What are you doing?

Upgrading to Sequelize 6 from 4.x.

We use DataType.TIME for TIMESTAMP postgres fields.

@AutoColumn({ type: DataType.TIME })
  practiceTime: Maybe<Date>;

However when this is getting inserted into sql it is being inserted as a date:
invalid input syntax for type time: "2021-05-18T08:00:00.000+00:00"

Time syntax should be: HH:MM:SS

What do you expect to happen?

DataType.TIME should insert fields in HH:MM:SS format

What is actually happening?

Trying to insert as full date strings.

Environment

Sequelize Versions:
"sequelize": "^6.6.2",
"sequelize-cli": "^6.2.0",
"sequelize-typescript": "^2.1.0",

  • Node.js version: v12.16.1
  • Operating System: Mac
  • If TypeScript related: TypeScript version: 3.7.5

Issue Template Checklist

How does this problem relate to dialects?

  • I think this problem happens regardless of the dialect.
  • I think this problem happens only for the following dialect(s):
  • I don't know, I was using PUT-YOUR-DIALECT-HERE, with connector library version XXX and database version XXX

Would you be willing to resolve this issue by submitting a Pull Request?

  • Yes, I have the time and I know how to start.
  • Yes, I have the time but I don't know how to start, I would need guidance.
  • No, I don't have the time, although I believe I could do it if I had the time...
  • No, I don't have the time and I wouldn't even know how to start.
@wbourne0 wbourne0 added status: understood For issues. Applied when the issue is understood / reproducible. topic: dates & times For issues and PRs. Things that involve dates and times. type: bug labels May 30, 2021
@wbourne0 wbourne0 linked a pull request May 30, 2021 that will close this issue
5 tasks
jemshid123 pushed a commit to jemshid123/sequelize that referenced this issue Jun 1, 2021
When a date is provided as input for time field convert it to time string

closes sequelize#13276
jemshid123 pushed a commit to jemshid123/sequelize that referenced this issue Jun 2, 2021
When a date is provided as input for time field convert it to time string

closes sequelize#13276
jemshid123 pushed a commit to jemshid123/sequelize that referenced this issue Jun 4, 2021
When a date is provided as input for time field convert it to time string

closes sequelize#13276
jemshid123 pushed a commit to jemshid123/sequelize that referenced this issue Jun 11, 2021
When a date is provided as input for time field convert it to time string

closes sequelize#13276
jemshid123 pushed a commit to jemshid123/sequelize that referenced this issue Jun 12, 2021
When a date is provided as input for time field convert it to time string

closes sequelize#13276
jemshid123 pushed a commit to jemshid123/sequelize that referenced this issue Jun 25, 2021
When a date is provided as input for time field convert it to time string

closes sequelize#13276
@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has been open for 7 days without activity. It will be closed if no further activity occurs. If this is still an issue, just leave a comment or remove the "stale" label. 🙂

@github-actions github-actions bot added the stale label Oct 27, 2021
@github-actions github-actions bot closed this as completed Nov 2, 2021
jemshid123 added a commit to jemshid123/sequelize that referenced this issue Jan 15, 2022
When a date is provided as input for time field convert it to time string

closes sequelize#13276
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale status: understood For issues. Applied when the issue is understood / reproducible. topic: dates & times For issues and PRs. Things that involve dates and times. type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants