Skip to content

gorm seems has a bug on time with timezone #219

@cnlangzi

Description

@cnlangzi

The connection can't be deleted.

We have two timezone now. One is postgres's , another is golang's.

In postgres, column may have a default value with now() (eg. allocation_connections.create_at). The timezone is set with postgres timezone.
In golang, we may upload some column with time.Now() (eg. allocation_connections.update_at). the timezone is set with golang timezone(it also is server's timezone)

there are two solutions:

  • should all time should be converted with a default timezone on postgres? if yes, what is the timezone . It is UTC ?
  • should globalization feature be implemented? time should be converted in different timezones automatically.

2021-06-21 03:06:43.899692 +0000 UTC > 2021-06-21 10:20:23.844087 +0800 CST m=-3564.945252206

Screen Shot 2021-06-21 at 11 24 21 AM

Screen Shot 2021-06-21 at 11 25 47 AM

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions