Error 1292: Incorrect datetime value: '0000-00-00' for column 'end_at' at row

 

StartAt     time.Time `json:"start_at" gorm:"comment:广告开始时间"`
EndAt time.Time `json:"end_at" gorm:"comment:广告结束时间"`

设置成

StartAt     *time.Time `json:"start_at" gorm:"comment:广告开始时间"`
EndAt *time.Time `json:"end_at" gorm:"comment:广告结束时间"`

或者

StartAt     sql.NullTime `json:"start_at" gorm:"comment:广告开始时间"`
EndAt. sql.NullTime `json:"end_at" gorm:"comment:广告结束时间"`

相关文章:

  • 2021-07-14
  • 2021-09-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-22
  • 2021-09-24
  • 2022-02-10
  • 2022-12-23
  • 2021-11-18
相关资源
相似解决方案