I'm trying to test that the time.Time
value I inserted into a postgres database is the same one I am querying out. Postgres drops the timezone though, so I'm wondering how can I get this testify/assert test to pass?
s.Equal(want.Date, got.Date)
Both are the dame datatype time.Time
but the first has the timezone:
2020-10-31 00:00:00 +0000 UTC
I created this value like this - time.Date()
must take a location, so I couldn't create it without one by passing nil:
want.Date := time.Date(2020, 10, 31, 00, 00, 00, 0000, time.UTC)
got.Date
coming from the database looks like:
2020-10-31 00:00:00 +0000 +0000
I can't change the database dropping the timezone, so how can I change how I create the date or how can I drop the timezone? Or perhaps there is another way I can assert that the year, month, and day, are the same?