douyi1779 2018-09-12 19:38
浏览 100
已采纳

golang现在用松鼠更新设置时间

Right now my container's timezone is different with MySQL's, and I need to run a query to just update the time field on MySQL to its timezone. Normally, I can run the query with "edited=NOW()", but with the Golang squirrel, it does not have a proper way to set this clause. I cannot change both my app and mysql container's timezone, and I just need to update the date in DB. Is there any way to do in Squirell properly?

  • 写回答

2条回答 默认 最新

  • duanniu4106 2019-01-02 22:56
    关注

    Instead of Set(column, "NOW()"), you need to do Set(column, sq.Expr("NOW()"))

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 Windows Script Host 无法找到脚本文件"C:\ProgramData\Player800\Cotrl.vbs”
  • ¥15 matlab自定义损失函数
  • ¥15 35114 SVAC视频验签的问题
  • ¥15 impedancepy
  • ¥15 求往届大挑得奖作品(ppt…)
  • ¥15 如何在vue.config.js中读取到public文件夹下window.APP_CONFIG.API_BASE_URL的值
  • ¥50 浦育平台scratch图形化编程
  • ¥20 求这个的原理图 只要原理图
  • ¥15 vue2项目中,如何配置环境,可以在打完包之后修改请求的服务器地址
  • ¥20 微信的店铺小程序如何修改背景图