我有一個表格包含列,我需要將此列中的時間與現在的時間進行比較,例如:created_atresult := database.DB.Where("code = ?", post.code).First(&post)if result.CreatedAt < time.Now() { // do something}我在編輯器中遇到錯誤:Invalid operation: result.CreatedAt > time.Now() (the operator > is not defined on Time)如何檢查日期是否過期?
- 1 回答
- 0 關注
- 82 瀏覽
添加回答
舉報
0/150
提交
取消