GORM Read Date as []uint8
The document you expected this should be explained
Hello, i am currently using GORM with mysql database from planetscale, when using it in my local mysql, date is getting read as a time.Time format, but when i migrate the data to planetscale, it gets read as a []uint8 eventhough it has the same date format. Is it a problem within GORM or plantescale mysql?
and how do i force read it as a time.Time othern than a []uint8 ?
Expected answer
GORM read date format as a time.Time not []uint8
Comment From: a631807682
it gets read as a []uint8 eventhough it has the same date format. Is it a problem within GORM or plantescale mysql?
Gorm will convert to the specified type according to the field type. There seems to be no reason to convert to []int8.
Can you provide the reproduction code?
Comment From: jinzhu
Should be caused by not using parseTime=true in the DSN.
https://github.com/go-sql-driver/mysql#parsetime