第一个问题,MySQL在保存datetime类型时,我已经用parse转换成本地时间了依然不能保存成本地时间,在数据库存的还是utc时间,是因为没有在创建连接时加上
loc=Local
第二个问题,就是datetime类型的字段在作为查询条件时,比较的时候报错
sql: Scan error on column index 5, name “created_at”: unsupported Scan, storing driver.Value type []uint8 into type *time.Time
在创建连接的时候加上
parseTime=true