go-gorm/datatypes

datatypes.Date Incorrectly Sets Time When Date::Value Is Called

bonedaddy opened this issue · 0 comments

When Date::Value is called it incorrectly sets the time. Note that it sets 0 for values such as hour, minute, etc... This leads to incorrect values being stored in the database.

For example here is the result of running time.Now().Add(<time duration>):

2021-03-04 11:02:03.392804646 +0000 UTC

But the same value returned from the database using datatypes.Date is:

2021-03-04 08:00:00 +0000

This basically makes the Date type completely useless