discord.py:如何在嵌入方式中显示如Discord消息时间戳中所示的日期?
我想复制以下时间的表示:我想重新创建的东西
我已经拥有的东西:< a href =“ https://i.sstatic.net/bdth9.png” rel =“ nofollow noreferrer”>我拥有的
代码:
created = ctx.guild.created_at
embed.add_field(name = f"Created:", value = f"{created}", inline=False)
如何重新创建它?
I want to replicate this representation of time: What I Want To Recreate
What I already have: What I Have
Code:
created = ctx.guild.created_at
embed.add_field(name = f"Created:", value = f"{created}", inline=False)
How can I recreate it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因此,Discord使用Epoch值来获得时间,并获得格式为
&lt; t:{epoch value}:{mode}&gt;
。要获得时期值,有一个函数知道为timestamp()
。因此,我们的新代码将是:
So, discord uses epoch value to get time and the format to get it is
<t:{epoch value}:{mode}>
. To get the epoch value there is a function know astimestamp()
.So our new code will be :