wechaty / go-wechaty

Go Wechaty is a Conversational SDK for Chatbot Makers Written in Go
https://github.com/wechaty/go-wechaty-getting-started
Apache License 2.0
489 stars 92 forks source link

[BUG] Message.Date()返回的是毫秒数,不是时间戳。 #151

Closed jmjoy closed 1 year ago

jmjoy commented 1 year ago

Describe the bug Message.Date()返回的是毫秒数,不是时间戳。

To Reproduce Steps to reproduce the behavior:

  1. OnMessage获得消息Message
  2. 调用Date()方法,打印,得到"55535-03-27T07:46:36.000+0800"
  3. 怀疑是毫秒数,于是time.Unix(message.Date().Unix()/1000, 0),得到正确的“2023-07-26T15:13:56.000+0800”

Expected behavior 希望得到“2023-07-26T15:13:56.000+0800”

Runtime environment

dchaofei commented 1 year ago

如何重现,我这边没有复现到这个问题,我的环境是: puppet: padlocal wechaty-docker: wechaty/wechaty:1.20

dchaofei commented 1 year ago

你这边用的是什么 puppet,初步猜测是有些 puppet 返回的是秒,有些是毫秒

jmjoy commented 1 year ago

用的这个:https://wechaty.js.org/docs/puppet-services/workpro

错怪go的sdk了 :-(

dchaofei commented 1 year ago

我先去申请个 workpro 的 token~

jmjoy commented 1 year ago

我先去申请个 workpro 的 token~

牛批,敬业!

dchaofei commented 1 year ago

已做兼容处理,升级到 v0.4.10 可解决